making var_dump look nice

i was var_dumping an array the other day, and it comes out like a massive string you cant read. a fast way to make this readable is just to add some pre tags to it.

HTML

var_dump_returl

PHP

// here is the original dumped array - result 1
$my_array = [ "1" => "one", "2" => "two", "3" => "three" ];
var_dump($my_array);
var_dump_returl
// using var_export
array ( 1 => 'one', 2 => 'two', 3 => 'three', )// using the pre tags
array (
  1 => 'one',
  2 => 'two',
  3 => 'three',
)
// use hightlight string to make it awesome!
<?php
$my_array 
=
;
?>

Other Items in php
Page Views

This page has been viewed 168 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹

Random Quote
You drown not by falling in the river, but by staying submerged.
Unknown