I have an tag to convert. I’m try do this with php functions:
How i can do that transformation?
content before @(XIMLoLxmTDw) content after => content before <div class="iframe-wrapper"><iframe src="https://www.youtube.com/embed/XIMLoLxmTDw" frameborder="0" allowfullscreen="true"></iframe></div> content after
>Solution :
function getStringBetween($str,$from,$to)
{
$sub = substr($str, strpos($str,$from)+strlen($from),strlen($str));
return substr($sub,0,strpos($sub,$to));
}
$string='<div class="iframe-wrapper"><iframe src="https://www.youtube.com/embed/XIMLoLxmTDw" frameborder="0" allowfullscreen="true"></iframe></div>';
$start='embed/';
$end='"';
$idYoutube=getStringBetween($string , $start,$end);
echo $idYoutube;