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.
2.1m questions
2.1m answers
60 comments
57.0k users