Convert var_dump of array back to array variable

var_export or serialize is what you’re looking for. var_export will render a PHP parsable array syntax, and serialize will render a non-human readable but reversible “array to string” conversion… Edit Alright, for the challenge: Basically, I convert the output into a serialized string (and then unserialize it). I don’t claim this to be perfect, but … Read more

How to see full content of long strings with var_dump() in PHP

You are using xdebug, which overloads the default var_dump() to give you prettier and more configurable output. By default, it also limits how much information is displayed at one time. To get more output, you should change some settings. Add this to the top of your script: ini_set(“xdebug.var_display_max_children”, ‘-1’); ini_set(“xdebug.var_display_max_data”, ‘-1’); ini_set(“xdebug.var_display_max_depth”, ‘-1’); From the … Read more

Make var_dump look pretty [duplicate]

I really love var_export(). If you like copy/paste-able code, try: echo ‘<pre>’ . var_export($data, true) . ‘</pre>’; Or even something like this for color syntax highlighting: highlight_string(“<?php\n\$data =\n” . var_export($data, true) . “;\n?>”); Reusable function: function highlight_array($array, $name=”var”) { highlight_string(“<?php\n\$$name =\n” . var_export($array, true) . “;\n?>”); } You can do the same with print_r(). For … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)