array in php example
Example 1: array php
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>
Example 2: array php
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>
Example 3: php array
<?php
$array = array("foo", "bar", "hello", "world");
var_dump($array);
?>
Example 4: array in php
<?php
$cars = array("Maserati", "Porsche", "BMW");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>
Example 5: php array
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>