note 18620 added to function.preg-replace-callback
| From: | \ " Prof . Nimnul \ | Date: | Tue, 29 Jan 2002 20:38:29 +0000 |
| Subject: | note 18620 added to function.preg-replace-callback | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25982@lists.php.net to get a copy of this message | ||
Here is a little example implementing <!--#include virtual="" --> parsing.
Maybe this is not the most optimal way, but it works.
function _my_callback($matches)
{
return my_ReadFromFile($matches[1]);
}
$str = preg_replace_callback('/<!--#include virtual="(.+?)" -->/',
'_my_callback', $str);
--
http://www.php.net/manual/en/function.preg-replace-callback.php
http://master.php.net/manage/user-notes.php?action=edit+18620
http://master.php.net/manage/user-notes.php?action=delete+18620
http://master.php.net/manage/user-notes.php?action=reject+18620