0

I got this error and I don't really know why.

switch($op) 
{
    case "check" : 
        $result = $Login->login($data,array()); 
        break;  
}

echo json_encode($result);

and, it's not echoing the string.

if I put an echo before or after, it works

echo json_encode($result);
echo '.';

returns

{"status":false,"errID":4,"errTxt":"Invalid password"}.

var_dump returns

string(50ish) "{"status":false,"errID":4,"errTxt":"Invalid password"}"

Any ideeas why it's not echoing it without other stuff echoed too?

Edit

$str = json_encode($result);  
echo $str;

returns nothing but

$str = json_encode($result);  
$str .= '-';
echo $str;

returns

{"status":false,"errID":3,"errTxt":"Invalid email"}-

So it won't echo the string, but if I append something after it, it will echo it.

LE: with die() after echo sill nothing

PuiuCristian
  • 163
  • 9

0 Answers0