Another example added (#27998)

* Another example added

Multiple datatypes added in Syntax section.

* Update index.md
pull/29885/head^2
Vlăduț Ilie 2018-12-17 06:14:22 +02:00 committed by Randell Dawson
parent 8217c89617
commit 9e1be6b7eb
1 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,15 @@ $bikes = array('Suzuki','BMW','Yamaha');
$bikes = ['Suzuki', 'BMW', 'Yamaha'];
```
PHP arrays can store more than one type of value at a time:
```
<?php
$arr = array('Suzuki', 3.1415, false, -273);
```
As you can see there is a string, a float number, a boolean valuea and an integer number.
## Key => Value
Arrays can also be defined with named keys, as shown below: