How can I explode all Youtube embed values from a text using PHP? For example I have the text:
Fails: <iframe width="560" height="315" src="http://www.youtube.com/embed/Ujwod-vqyqA" frameborder="0" allowfullscreen></iframe>
More fails: <iframe width="560" height="315" src="http://www.youtube.com/embed/DYRTzXSYixQ" frameborder="0" allowfullscreen></iframe>
More the more: <iframe width="560" height="315" src="http://www.youtube.com/embed/uLWqUW_U6dQ" frameborder="0" allowfullscreen></iframe>
And I want to use one of all videos embed for my facebook post, for example first video embed:
https://i3.ytimg.com/vi/Ujwod-vqyqA/mqdefault.jpg
How can I do this? I tried with strpos
, but this does not work.