Answers for "php dump array with data?"

PHP
13

print array php

<?php
$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
echo "<pre>";
print_r ($a);
echo "</pre>";
?>
  
Output:

Array
(
    [a] => apple
    [b] => banana
    [c] => Array
        (
            [0] => x
            [1] => y
            [2] => z
        )
)
Posted by: Guest on February-26-2020
1

var dump php look clear

// make php var_dump print_r var_export look clear and pretty
echo '<pre>' . var_export($data, true) . '</pre>';
die('<pre>' . var_export($data, true) . '</pre>');
Posted by: Guest on July-23-2020

Browse Popular Code Answers by Language