Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php print array

// raw array output
print_r($arr);

// the above well-formatted
echo '<pre>'; print_r($array); echo '</pre>';

// more details like datatype and length
var_dump($arr);

// output that PHP understands
var_export($arr);

// by foreach loop
foreach($arr as $key=>$value)
  echo $key, '=>', $value;	// $value must be convertible to string
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #print #array
ADD COMMENT
Topic
Name
4+3 =