Skip to content
Advertisement

Function like var_dump in php

I need a function like var_dump($object) in php The problem is that the Var_dump function print every thing on the screen and I just need the answer in a variable. I mean sth like $variable=var_dump($object); And I dont want to see anything on screen! thanks

Advertisement

Answer

$variable=var_export($object,true);

you needs var_export

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement