Another example added (#27998)
* Another example added Multiple datatypes added in Syntax section. * Update index.md
This commit is contained in:
committed by
Randell Dawson
parent
8217c89617
commit
9e1be6b7eb
@ -23,6 +23,15 @@ $bikes = array('Suzuki','BMW','Yamaha');
|
|||||||
$bikes = ['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
|
## Key => Value
|
||||||
|
|
||||||
Arrays can also be defined with named keys, as shown below:
|
Arrays can also be defined with named keys, as shown below:
|
||||||
|
Reference in New Issue
Block a user