Search
 
SCRIPT & CODE EXAMPLE
 

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];
Comment

PREVIOUS NEXT
Code Example
Php :: php join 
Php :: laravel db raw count where 
Php :: how to fetch the sum of column in php mysql 
Php :: update laravel 7 to 8 
Php :: inverse hyperbolic cosine php 
Php :: laravel where and where 
Php :: Best Security tools for php 
Php :: php recortar string 
Php :: php get country code from country name 
Php :: update url wordpress 
Php :: PHP Ternary Operator With Elseif Example 
Php :: types of method in api 
Php :: where is in array laravel 
Php :: carbon this month first day 
Php :: php namespace class 
Php :: match php 
Php :: Laravel return empty relationship on model when condition is true 
Php :: laravel_login 
Php :: php buffer 
Php :: wp_query custom post type 
Php :: yii2 migration --fields foreign 
Php :: -sale_price 
Php :: connect php in sql server 
Php :: convert to string php 
Php :: guarded and fillable in laravel 
Php :: wp wc php edit archive-product category page 
Php :: Add button next to "ADD TO CART" on product archive 
Php :: like query with prepare wordpress 
Php :: guzzlehttp submit form file 
Php :: Laravel Retrieving & Deleting An Item from session 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =