note 130059 added to function.array
| From: | goktug-51@hotmail.com | Date: | Wed, 26 Feb 2025 14:05:52 +0000 |
| Subject: | note 130059 added to function.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221885@lists.php.net to get a copy of this message | ||
I want to point smt important about accessing array value from within double quotes that didn't
get mentioned in the article.
As article says you can access array values from within double quotes, using the curly braces
syntax. However, you can also access it without curly braces and array access quotes:
$foo = array('bar' => 'baz');
echo "Hello $foo[bar]";
returns "Hello baz" with no error
Note: I didn't check for all of the PHP versions.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 78.173.116.27)
----
Manual Page -- https://php.net/manual/en/function.array.php
Edit -- https://main.php.net/note/edit/130059
Del: integrated -- https://main.php.net/note/delete/130059/integrated
Del: useless -- https://main.php.net/note/delete/130059/useless
Del: bad code -- https://main.php.net/note/delete/130059/bad+code
Del: spam -- https://main.php.net/note/delete/130059/spam
Del: non-english -- https://main.php.net/note/delete/130059/non-english
Del: in docs -- https://main.php.net/note/delete/130059/in+docs
Del: other reasons-- https://main.php.net/note/delete/130059
Reject -- https://main.php.net/note/reject/130059
Search -- https://main.php.net/manage/user-notes.php