Parse source for braces

From: Date: Mon, 06 Jan 2003 23:00:34 +0000
Subject: Parse source for braces
Groups: php.general 
Request: Send a blank email to php-general+get-130510@lists.php.net to get a copy of this message
I need to parse some source code to find the contents of a specific function. The only way I can think of is to load the source file into a string find the function by name and parse the text in the string and find the end brace of the function, made difficult by the existence of all the other braces that may be there (if, while, switch, foreach, etc...). Anybody have some code to do this??? function someFunc() { if(something) { something... } while(something) { something... } } // So I need the code from the beginning of the function to here TIA -Shawn

« previous php.general (#130510) next »