The Blog

How to get the string value of HTML tag? Posted on

function getTextBetweenTags($string, $tagname) 
{
$pattern = "/<$tagname ?.*>(.*)<\/$tagname>/";     
preg_match($pattern, $string, $matches);     
return $matches[1]; 
} 
This entry was posted in PHP. Bookmark the permalink.

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *



CAPTCHA
Change the CAPTCHA codeSpeak the CAPTCHA code