0
I have a text in wordpress and in this text has a link to youtube:
Health" every Monday at 9:15 with reruns at Fridays, from 1 pm.
During the exhibition of attraction, the presenter usually receives health professionals to give tips on feeding, medication, posture and quality of life to viewers.https://www.youtube.com/watch?v=tNR3lGyiLQA
Brief history of the presenter: Gisela Savioli was the nutritionist responsible for feeding the
created this express, but it’s not working, it’s still coming null, someone can help me?
public function getUrlFromContent($content){
$video_url=null;
$pattern = '/(youtu|y2u)(be)?\.(com|be)(\.br)?\/(watch\?v=)?[^"\&\?\/ ]{11}/i';
preg_match($pattern, $content, $result_youtube);
if (isset($result_youtube[0])) {
$video_url = "http://" . $result_youtube[0];
}
return $video_url;
}
The answer worked?
– Allan Andrade