note 37226 added to function.substr
| From: | wels at advanets dot com | Date: | Fri, 07 Nov 2003 06:22:45 +0000 |
| Subject: | note 37226 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60042@lists.php.net to get a copy of this message | ||
#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 "
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37226
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37226&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37226&report=yes
Search -- http://master.php.net/manage/user-notes.php