note 37227 deleted from function.substr by didou
| From: | didou@php.net | Date: | Fri, 07 Nov 2003 08:37:47 +0000 |
| Subject: | note 37227 deleted from function.substr by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60055@lists.php.net to get a copy of this message | ||
Note Submitter: wels@advanets.com
----
#here is a way to get a sub string that is encapsulated
#between two known strings
#for example:
$myContent =" I live in New York City ";
$myStartSub = "live in";
$myEndSub ="City";
$my_substr= substr($myContent,strpos($myContent,$myStartSub ),
strpos($myContent,$myEndSub)-strpos($myContent,$myStartSub ));
echo $my_substr;
# the end result would be
# myEndSub = " New York "