[Openfirst-cvscommit] base/includes functions.php,1.2,1.3
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-06-29 23:41:31
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21801/includes Modified Files: functions.php Log Message: Added ofStripLineComment() Index: functions.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions.php 29 Jun 2005 23:21:20 -0000 1.2 --- functions.php 29 Jun 2005 23:41:19 -0000 1.3 *************** *** 91,93 **** --- 91,103 ---- } } + + /** Strip line comment. + * Given a string and an array of commentors (in PHP, it would be array('#', '//')), + * remove all end-of-line comments. + * Note that this only works if you feed it one line at a time. + */ + function ofStripLineComment($commentors, $text) { + $parts = explode($commentors, $text, 2); + return $parts[0]; + } ?> |