PHP Transform Associative Array do tablicy
$array = array_values($array);
Esternome
$array = array_values($array);
<?php
$associativeArray = [
"carOne" => "BMW",
"carTwo" => "VW",
"carThree" => "Mercedes"
];
echo $associativeArray["carTwo"] . " Is a german brand";
?>
$arr = array('lang1' => 'php','lang2' => 'java','lang3' => 'python');
if ( in_array( 'java', $arr ) ) {
echo 'exists';
}else{
echo 'not exists';
}
<?php
$arr = array('fruit' => 'mango', 'vegetable' => 'tomato', 'thing' => 'bag');
echo $arr['fruit'];
/*OUTPUT
mango*/
?>
Array
(
[Ahmed] => Rofy
[Abdallah] => Oda
[Michel] => Mic
[Yahia] => ENG
)
<?php
$arr = array('fruit' => 'mango', 'vegetable' => 'tomato', 'thing' => 'bag');
echo $arr[1]
//OUTPUT
//mango
?>