Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 382
Abadis Avatar asked Dec 19 '25 11:12

Abadis


1 Answers

$variable=var_export($object,true);

you needs var_export

like image 147
Shakti Singh Avatar answered Dec 22 '25 02:12

Shakti Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!