-1

I have a script that I can get the YouTube videos

$path_to_file = realpath('index.txt');
$videolink = @file_get_contents($path_to_file);


if(isset($videolink))
{
include('curl.php');
include('youtube.php');
$tube = new youtube();
$links = $tube->get($videolink);

But sometimes it does not show result So I do something like this:

if(!$links) {
go back and try again

when script goes to back and starts again, php makes many errors like "Cannot redeclare function" and ...

what can i do?

If you need more information please tell me.

1 Answers1

0

May be when your code go back. It includes curls.php and youtube.php again. In this case, replacing include with include_once might enough.

This link might help you.

Community
  • 1
  • 1