I have this type of string, with an iframe (youtube video). How can I remove iframe from the string end echo only text?
Scelerisque scelerisque. Sit elit vut sit, aliquam. Elementum. Enim dignissim nisi mauris, aliquet aenean, proin, porttitor tristique et, pulvinar tincidunt! Diam risus eu diam, ultrices diam pulvinar platea ridiculus augue adipiscing aliquet adipiscing a mid lundium, ultricies eros, pulvinar? Etiam, sagittis dignissim egestas sit.<iframe width="560" height="315" src="http://www.youtube.com/embed/f8Q_BHzJ0fI" frameborder="0" allowfullscreen></iframe>Cum integer. Sit nisi. Augue, risus, scelerisque aliquam aliquet nunc nascetur purus! Diam ut sit lundium a phasellus ac pulvinar egestas nec! Lectus urna habitasse lacus turpis nunc quis tortor integer.
$string = preg_replace('/<iframe.*?\/iframe>/i','', $originalString);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With