<?php
$array = array();
$array['{name}'] = "Agustian Romy Ariansyah";
$array['{detail.country}'] = "Indonesia";
$array['{detail.age}'] = "32";
print_r($array);
/*
Array
(
[{name}] => Agustian Romy Ariansyah
[{detail.country}] => Indonesia
[{detail.age}] => 32
)
*/
echo $array['{name}']; //Agustian Romy Ariansyah
echo count($array); //3
echo implode(array_keys($array)); //{name}{detail.country}{detail.age}
?>
Minggu, 13 Februari 2022
PHP Create Array Value With Key
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar