get value from array in php code example
Example 1: array values php
<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
Example 2: php get all values from array
array_values(array)
Example 3: php return array
<?php
function data() {
$out[0] = "abc";
$out[1] = "def";
$out[2] = "ghi";
return $out;
}
$data = data();
foreach($data as $items){
echo $items;
}