You can either use the PHP print_r() or var_dump() statement to see or check the structure and values of an array in human-readable format on the screen. The var_dump() statement however gives more information than print_r(). Let's see how it basically works:
<?php
$cities = array("London", "Paris", "New York");
// Print the cities array
Print_r($cities);
echo "<hr>";
var_dump($cities);
?>
Use the PHP
print_r()orvar_dump()StatementYou can either use the PHP
need an explanation for this answer? contact us directly to get an explanation for this answerprint_r()orvar_dump()statement to see or check the structure and values of an array in human-readable format on the screen. Thevar_dump()statement however gives more information thanprint_r(). Let's see how it basically works: