将php变量设置为string

时间:2016-01-15 23:57:09

标签: php

我有这个:

$rm = json_decode($room_list[0]['room']);

我想设置一个变量$ string,其中包含上述变量的echo结果 例如,IF:

echo json_decode($room_list[0]['room'];

回声:Lorem Ipsum <a href="www.google.com>GG</a>.

我希望字符串为:

$string = 'Lorem Ipsum <a href="www.google.com>GG</a>.'

我该怎么做?

1 个答案:

答案 0 :(得分:0)

您似乎正在尝试这样做:how to use JSON.stringify and json_decode() properly

所以基本上,从那个答案中取$rm =并将with i(username, name) as (values (?, ?)) insert into access_log (username ,name ,uid ) values (select i.username ,i.name ,tab.uid from i join listofusers tab on tab.username = i.username ) 放在前面:)