note 82818 added to function.preg-match
| From: | Zander at osu1 dot php dot net | Date: | Sun, 27 Apr 2008 13:44:38 +0000 |
| Subject: | note 82818 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138845@lists.php.net to get a copy of this message | ||
I use this code to get what is between 2 tags, but there is a problem:
<?php
preg_match("/(<tr class=\"lit\"[^>]*>)(.*)(<\/tr>)/", $Rec_Data,
$coincidencias);
?>
I want it to get EXAMPLE in this code <tr class="lit">EXAMPLE</tr>
But when if the whole code is something like:
<tr class="lit">EXAMPLE</tr><tr>LOL</tr> it doesnt only get
EXAMPLE, it gets EXAMPLE</tr><tr>LOL, is there anything to get just EXAMPLE?
Thanks in advance
----
Server IP: 130.206.1.5
Probable Submitter: 88.31.51.253
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/82818
Del: integrated -- https://master.php.net/note/delete/82818/integrated
Del: useless -- https://master.php.net/note/delete/82818/useless
Del: bad code -- https://master.php.net/note/delete/82818/bad+code
Del: spam -- https://master.php.net/note/delete/82818/spam
Del: non-english -- https://master.php.net/note/delete/82818/non-english
Del: in docs -- https://master.php.net/note/delete/82818/in+docs
Del: other reasons-- https://master.php.net/note/delete/82818
Reject -- https://master.php.net/note/reject/82818
Search -- https://master.php.net/manage/user-notes.php