Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get html tags from string

$html = '<div><p>Some text</p><iframe src="http://www.source.com"></iframe></div>';

$start = strpos($html, 'src="') + 5;
$length = strpos($html, '"></iframe') - $start;
$src = substr($html, $start, $length);

echo $src;

or
  
var_dump(simplexml_load_string($rss_feed));

or

$rssFeed = '<div>
    <p>
        Some text
    </p>
    <iframe src="http://www.source.com"></iframe>
</div>';

$rssArray = explode('"', $rssFeed);

echo $rssArray[1];
 
PREVIOUS NEXT
Tagged: #php #html #tags #string
ADD COMMENT
Topic
Name
5+9 =