htmlspecialchars() parameter warning when I try to decode a json-String
- monstah
- Member | 3
the exact message: “htmlspecialchars() expects parameter 1 to be string, object given in ../nette.min.inc”
As the headline determines, I ve got a warning, when I try to decode a String into a json-Object in PHP. Any suggestions? I'm just using the method json_decode() with a json-String(!).
thx for the replies,
Chris
- monstah
- Member | 3
Hello,
I think I “fixed” it. Fortunately it had nothing to do with the decode-method. I tried to create a variable inside the latte template language as followed:
{$r = $decodedResponse->body}
and switched to the standard php version instead:
<?php
$r = $decodedResponse->body;
?>
The warnings are gone and I am new to latte, so I think latte was trying to print a php-Object and gave me this warning? But it shouldn't be impossible to create a variable in latte at least, or am I wrong? thx for replies,
Chris