note 57667 deleted from function.preg-split by tularis
| From: | tularis@php.net | Date: | Thu, 03 May 2007 22:25:17 +0000 |
| Subject: | note 57667 deleted from function.preg-split by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126174@lists.php.net to get a copy of this message | ||
Note Submitter: nospam at emails dot com
----
Looks like this one looks better :)
<?php
$pattern =
'/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/';
$html_string = '<html><body><p class="a<weird>name">The
classname is not seen as a different tag</p></body></html>';
$html_array = preg_split ($pattern, trim ($html_string), -1, PREG_SPLIT_DELIM_CAPTURE |
PREG_SPLIT_NO_EMPTY);
?>