Remove indices from array

2

How to remove indexes from an array?

Original Array

["Torrada" => 4,"Cachorro quente" => 1]

for

[4,1]
    
asked by anonymous 16.06.2018 / 04:56

1 answer

3

The function array_values returns all values in an array:

$Array = ["Torrada" => 4,"Cachorro quente" => 1];
$Valores = array_values($Array);
print_r($Valores);

Output:

Array
(
    [0] => 4
    [1] => 1
)

Reference

16.06.2018 / 05:06