If I use print_r or var_dump it displays the result on the screen, but I want this data to be stored in a variable so that I can write it to a file.
print_
var_dump
How do I do this?
$var = print_r($what, true);
You must add true into print_r.
1.4m articles
1.4m replys
5 comments
57.0k users