note 55370 added to function.token-get-all
| From: | phpcomments at majiclab dot com | Date: | Mon, 01 Aug 2005 17:08:52 +0000 |
| Subject: | note 55370 added to function.token-get-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92877@lists.php.net to get a copy of this message | ||
Regarding bertrand at toggg dot com's comment: there is another case of the { } curly braces
being used in PHP, but the token_get_all() function treats it just like a code block: string index.
Example:
<?php
$text = "Hello";
if ($text{ 0 } == 'H') {
echo "This example uses { for both a PHP block and a string index.";
}
?>
Just in case some people were wondering. Since PHP treats them as the same token, it makes some
things a little more interesting for parsing. You can't just assume that { ... } is a code
block, it could just be a number referring to an index of a string.
----
Submitter IP: 66.207.199.35
----
Manual Page -- http://www.php.net/manual/en/function.token-get-all.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55370
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55370&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55370&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55370&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55370&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55370&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55370&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55370&report=yes
Search -- http://master.php.net/manage/user-notes.php