Answers for "print array on php"

PHP
12

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
3

print array on php

foreach($results['data'] as $result) {
    echo $result['type'], '<br>';
}
Posted by: Guest on July-27-2020
0

print array items in php

<?php $data = array('a'=>'apple','b'=>'banana','c'=>'orange');?>
<pre><?php print_r($data); ?></pre>
Posted by: Guest on July-15-2021

Browse Popular Code Answers by Language