array element php code example
Example 1: array values php
<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
Example 2: php array
<?php
$array = array("foo", "bar", "hello", "world");
var_dump($array);
?>
Example 3: php define variables from array associative
<?php
$array = [
'key1' => 'foo',
'key2' => 'bar',
];
extract($array);
echo $key1; //print foo
echo $key2; //print bar
?>