php - The explode function 'forgets' some chars -
i writing code header, description , image url youtube video video url.
i using in explode function this.
problem / character. when tried pull url: https://www.youtube.com/watch?v=upkq8d4j5e8&spfreload=10, got name of video, got this:
<h1 class="watch-title-container" >\ \ \ \ <span id="eow-title" class="watch-title" dir="rtl" title="סינון אתרים וחסימת אתרים לילדים ומבוגרים על ידי התוכנה k9">\ סינון אתרים וחסימת אתרים לילדים ומבוגרים but full div in youtube is:
<h1 class="watch-title-container"> <span id="eow-title" class="watch-title" dir="rtl" title="סינון אתרים וחסימת אתרים לילדים ומבוגרים על ידי התוכנה k9"> סינון אתרים וחסימת אתרים לילדים ומבוגרים על ידי התוכנה k9 </span> </h1> it's missing </span> , </h1>!
my code is:
$content_tube = file_get_contents($url_tube); $name_first_step = explode( '<div id="watch-headline-title">' , $content_tube ); $name_second_step = explode("</div>" , $name_first_step[1] );
Comments
Post a Comment