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

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -