note 99015 deleted from language.types.array by nikic
| From: | nikic@php.net | Date: | Mon, 07 Oct 2013 22:07:59 +0000 |
| Subject: | note 99015 deleted from language.types.array by nikic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196484@lists.php.net to get a copy of this message | ||
Note Submitter: ivegner at yandex dot ru
----
Like in Perl, you can use curly braces ({}) instead of square brackets ([]) to access array members:
<?php
$a = array ();
$a[7] = 'seven';
$a{'hello'} = 'world';
print $a{7} . ' ' . $a['hello'];
?>
Prints 'seven world'.