print array in php
snippet in php

print array php

user8983

<?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
        )
)

php echo array

user3512

<?php
$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
print_r ($a);
?>

php echo array

user1349

foreach($results as $result) {
	echo $result . '<br>';
}

print array in php

user2129

print_r($array);

print array on php

user4142

foreach($results['data'] as $result) {
    echo $result['type'], '<br>';
}

php echo array

user3303

<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>