php aray code example
Example 1: array php
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
// as of PHP 5.4
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>
Example 2: php arrays
$nums = [1, 2, 3, 4, 5];
Example 3: php array
<?php
$array = array("foo", "bar", "hello", "world");
var_dump($array);
?>
Example 4: PHP Arrays
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>