1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
$statut_txt ="Victoria's Secret - Top 10<br>www.pixmodel.com<br><br>
<iframe width='260' height='146' src='http://www.youtube.com/embed/-8x3aAUmFp8' frameborder='0' allowfullscreen></iframe>";
//pas la peine de fantasmer sur la vidéo bande de coquins ;)
// ici je traite juste le principe d'activation d'une URL
$statut_txt= preg_replace('#(http://www.youtube.com)#', 'youtube.com', $statut);
$statut_txt= preg_replace('#(https://|http://)#', '', $statut_txt);
$statut_txt= preg_replace('/(www.[^ ]+)/', '<a href="http://\1" target="_blank">\1</a>', $statut_txt);
$statut_txt= preg_replace('#<3#i', '<img src="http://www.pixmodel.com/coeur.gif" height="15px" style="float:left">', $statut_txt);
$statut_txt= preg_replace('#(youtube[^ ]+)#', 'http://www.\1', $statut_txt);
// A partir de la ça se gate
// je veux récuperer dans l'IFRAME, l'adresse (src) : <iframe width="260" height="146" src="(.+)" frameborder="0" allowfullscreen></iframe>
// puis remplacer
// (http://www.youtube.com/embed/[^ ]+)
// par
// http://www.youtube.com/watch?v=\1 |
Partager