Jump to content

Print each array element on new line


savagenoob

Recommended Posts

try

 

<?php
    echo "<pre>";
    print_r($array);
    echo "</pre>";
?>

 

or you could use the following

 

<?php
    foreach($array as $key => $item){
        echo "[" . $key . "] => " . $value . "<br />"; 
    }
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.