I have this:
$rm = json_decode($room_list[0]['room']);
and i want to set a variable $string which include the result of echo of above variable.
For Example, IF:
echo json_decode($room_list[0]['room'];
echos: Lorem Ipsum <a href="www.google.com>GG</a>.
i want the string to be:
$string = 'Lorem Ipsum <a href="www.google.com>GG</a>.'
How can i do that?
json_encode()returns a value. You can either assign it to a variable, or echo it. Either way, you're assigning or echoing the same thing.echois showing?json_decodeis returning a string, and you assign that to a variable, the variable contains a string.