note 63356 deleted from function.preg-match by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 18:29:28 +0000 |
| Subject: | note 63356 deleted from function.preg-match by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127621@lists.php.net to get a copy of this message | ||
Note Submitter: brodseba at brodseba dot com
----
This little function is self-explaining.
function preg_match_between($a_sStart, $a_sEnd, $a_sSubject)
{
$pattern = '/'. $a_sStart .'(.*?)'. $a_sEnd .'/';
preg_match($pattern, $a_sSubject, $result);
$pattern = '/'. $a_sStart .'/';
$result = preg_replace($pattern, '', $result[0]);
$pattern = '/'. $a_sEnd .'/';
$result = preg_replace($pattern, '', $result);
return $result;
}