note 82091 added to function.substr
| From: | (adityabhai@gmail.com) | Date: | Thu, 27 Mar 2008 11:26:35 +0000 |
| Subject: | note 82091 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137627@lists.php.net to get a copy of this message | ||
Here is my simple test code which you can use:
<?
$example_html = "<p>sample1 sample2</p><title>hi how are
you</title><p>just checking</p>";
$paragraph_text = multi_between('<p>', '</p>', $example_html);
//Prints an arry of:
//Array ( [1] => sample1 sample2 [2] => just checking )
print_r($paragraph_text);
function multi_between($this, $that, $inthat)
{
$counter = 0;
while ($inthat)
{
$counter++;
$elements[$counter] = before($that, $inthat);
$elements[$counter] = after($this, $elements[$counter]);
$inthat = after($that, $inthat);
}
return $elements;
}
//Get the help functions from biohazard's post below.
?>
----
Server IP: 203.199.69.133
Probable Submitter: 122.169.40.153
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- https://master.php.net/note/edit/82091
Del: integrated -- https://master.php.net/note/delete/82091/integrated
Del: useless -- https://master.php.net/note/delete/82091/useless
Del: bad code -- https://master.php.net/note/delete/82091/bad+code
Del: spam -- https://master.php.net/note/delete/82091/spam
Del: non-english -- https://master.php.net/note/delete/82091/non-english
Del: in docs -- https://master.php.net/note/delete/82091/in+docs
Del: other reasons-- https://master.php.net/note/delete/82091
Reject -- https://master.php.net/note/reject/82091
Search -- https://master.php.net/manage/user-notes.php