<?php
$good =['name'=> 'prinsha','surname'=> 'jangam'];
$good['doggy'] = 'newjippu';
//echo $good['name'];
foreach($good as $key=>$item){
echo $key .' '.$item. "\n";
}
$array = [1, 2, 3,4, 5] ;
// Mulltidimensional array
$dogs = [
['breed' => 'Cocker Spaniel', 'name' => ' Jypsy', 'size' => [
'width': 5,
'height': 10]],
['breed' => 'german ', 'name' => ' Jypsy', 'size' => [
'width': 5,
'height': 10]],
['breed' => 'Shiba Inu', 'name' => ' Kotetsu', 'size' => [
'width': 5,
'height': 10]],
['breed' => 'Unknown', 'name' => ' Sheru Bahadur', 'size' => [
'width': 5,
'height': 10]],
];
echo $dogs[0];
// we can use this to represent record of any kind, for example student record, anything, even complex things
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
- Parse error: syntax error, unexpected ':', expecting ']' in /in/i7tF3 on line 14
Process exited with code 255.
preferences:
178.13 ms | 1395 KiB | 36 Q