array values php
snippet in php

php get all values from array

user7441

array_values(array)

php array_values

user8146


<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
// ["XL","gold"]

array values php

user1693

<?php
  
$array = array("size" => "XL", "color" => "gold");

print_r(array_values($array));

?>

php return array

user1353

<?php

function data() {
    $out[0] = "abc";
    $out[1] = "def";
    $out[2] = "ghi";
    return $out;
}

$data = data();
foreach($data as $items){
    echo $items;
}