note 50721 added to function.token-get-all

From: Date: Tue, 08 Mar 2005 06:41:13 +0000
Subject: note 50721 added to function.token-get-all
Groups: php.notes 
Request: Send a blank email to php-notes+get-86086@lists.php.net to get a copy of this message
If you want to retrieve the PHP blocks then you will count up the opening curly braces '{' and down the closing ones '}' (counter zero means block finished) CAUTION: the opening curly braces token can take 3 values: 1) '{' for all PHP code blocks, 2) T_CURLY_OPEN for "protected" variables within strings as "{$var}" 3) T_DOLLAR_OPEN_CURLY_BRACES for extended format "${var}" On the other hand, closing token is allways '}' ! So counting up must take place on the 3 tokens: '{' , T_CURLY_OPEN and T_DOLLAR_OPEN_CURLY_BRACES Have fun with PHP tokenizer ! ---- Manual Page -- http://www.php.net/manual/en/function.token-get-all.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50721 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50721&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50721&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50721&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50721&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50721&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50721&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86086) next »