I have text in wordpress and this text has a link to youtube:
Health "every Monday, at 9:15 am, with a repeat of the Fridays, from 1 pm
During the attraction, the presenter usually receives health professionals to feeding, medication, posture and quality of life viewers.Brief history of the presenter: Gisela Savioli was the nutritionist responsible for feeding the
I have created this express, but it is not working, it is still coming null, can anyone 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;
}