开发者

putting print_r results in variable

In PHP I can say:

print_r($var);

What I can't d开发者_StackOverflow社区o (at least I don't know how) is:

$var_info = print_r($var);

How can I accomplish the effect of putting the results of a print_r inside a variable?

PHP v5.3.5


When the second parameter is set to TRUE, print_r() will return the information rather than print it

$var_info = print_r($var,true);


$var_info = print_r($var, true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜