dataarray php 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 define variables from array associative
<?php
$array = [
'key1' => 'foo',
'key2' => 'bar',
];
extract($array);
echo $key1; //print foo
echo $key2; //print bar
?>