Hello Guys,I want help from you.It shows error "eregi is deprecated" <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past require_once('lib/youtube.lib.php'); if(eregi('youtube.com|localhost',$_GET['url'])){ if(!eregi('www.',$_GET['url'])){ $_GET['url'] = str_replace('http://','http://www.',$_GET['url']); } list($video_id,$download_link) = get_youtube($_GET['url']); ?> <p> <img src="http://img.youtube.com/vi/<?php echo trim($video_id);?>/1.jpg" alt="Preview 1" class="ythumb" /> <img src="http://img.youtube.com/vi/<?php echo trim($video_id);?>/2.jpg" alt="Preview 2" class="ythumb" /> <img src="http://img.youtube.com/vi/<?php echo trim($video_id);?>/3.jpg" alt="Preview 3" class="ythumb" /> </p> <p> <a href="download.php?url=<?php echo urlencode($download_link);?>" class="ydl" title="Download as FLV">Download FLV</a> <a href="download.php?url=<?php echo urlencode($download_link.'&fmt=18');?>" class="ydl" title="Download as MP4">Download MP4</a> <a href="download.php?url=<?php echo urlencode($download_link.'&fmt=17');?>" class="ydl" title="Download as 3GP">Download 3GP</a> </p> <?php } else{ die('<span style="color:red;">Sorry, the URL is not recognized..</span>'); } ?> PHP: How can I solve it ?
Thanks For your response but,I don't know where to change it.I had posted the code also.Can you replace it with "preg_match" & posted it again.It will be great Thanks For you if you do this. Thanks & Regards, Sonu21
Be sure to test the code in real situations. I might made a mistake. I do not test what I write in this forum. <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past require_once('lib/youtube.lib.php'); if(preg_match('/(.*)(youtube.com|localhost)(.*)/i',$_GET['url'])){ if(!preg_match('/(.*)www\.(.*)/i',$_GET['url'])){ $_GET['url'] = str_replace('http://','http://www.',$_GET['url']); } list($video_id,$download_link) = get_youtube($_GET['url']); ?> <p> <img src="http://img.youtube.com/vi/<?php echo trim($video_id);?>/1.jpg" alt="Preview 1" class="ythumb" /> <img src="http://img.youtube.com/vi/<?php echo trim($video_id);?>/2.jpg" alt="Preview 2" class="ythumb" /> <img src="http://img.youtube.com/vi/<?php echo trim($video_id);?>/3.jpg" alt="Preview 3" class="ythumb" /> </p> <p> <a href="download.php?url=<?php echo urlencode($download_link);?>" class="ydl" title="Download as FLV">Download FLV</a> <a href="download.php?url=<?php echo urlencode($download_link.'&fmt=18');?>" class="ydl" title="Download as MP4">Download MP4</a> <a href="download.php?url=<?php echo urlencode($download_link.'&fmt=17');?>" class="ydl" title="Download as 3GP">Download 3GP</a> </p> <?php } else{ die('<span style="color:red;">Sorry, the URL is not recognized..</span>'); } ?> PHP: