html - PHP exploding url from text, possible? -


i need explode youtube url line:

[embed]https://www.youtube.com/watch?v=l3hqmbqawrc[/embed] 

it possible? need delete [embed] & [/embed].

preg_match need.

<?php  $str = "[embed]https://www.youtube.com/watch?v=l3hqmbqawrc[/embed]"; preg_match("/\[embed\](.*)\[\/embed\]/", $str, $matches); echo $matches[1]; //https://www.youtube.com/watch?v=l3hqmbqawrc 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -