|
December 24th, 2007
You can use a regular expression and preg_match.
$haystack = "<html>WORDS</html>";
$pattern = "/(<.*>)(.*)(</.*>)/";
$return = preg_match($pattern, $haystack);
$return will be a four-cell array. $return[0] contains all of $haystack. $return[1] contains <html>, $return[2] contains WORDS. $return[3] contains </html>.
http://us.php.net/manual/en/function.preg-match.php
|