note 41778 added to function.preg-match-all

From: Date: Thu, 22 Apr 2004 01:00:56 +0000
Subject: note 41778 added to function.preg-match-all
Groups: php.notes 
Request: Send a blank email to php-notes+get-68498@lists.php.net to get a copy of this message
If you want to extract the list of php functions in one of your library (ie, includes) for documentation or any purpose use the below: $filename = 'library.php'; $fp = fopen($filename,'r'); if ($fp !== false) { $str = fread($fp, filesize ($filename)); $count = preg_match_all ("|function[ ]+(.*)[\(](.*)[\)]|U", $str, $out, PREG_PATTERN_ORDER); for ($i=0; $i<$count; $i++) { if (!eregi('array',$out[1][$i])) { echo '#T='.$out[1][$i]."\n"; echo $out[1][$i].'('.$out[2][$i].')'."\n\n"; } } } ---- Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41778 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41778&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41778&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68498) next »