el caso es que esa funcion me imprime una salida en formato texto
y me gustaria sacarlo a $salida para usar en mas de un sitio osea definirle un vallor de salida para despues utilizarlo mas vezes
os dejo el code si quereis
Código PHP:
Ver original<?php
function curl($link, $cookie) {
global $Use_fgc;
// Using file_get_contents.
'method' => "GET",
'max_redirects' => 1,
'header' => "Accept-language: en\r\n" .
"Cookie: $cookie\r\n" .
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2\r\n"
);
$page = implode("\r\n", $http_response_header) . "\r\n\r\n" . $page; } else {
// Using cURL.
curl_setopt($ch, CURLOPT_USERAGENT
, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2"); if ($errz != 0) {
}
}
return($page);
}
function stop($text) {
}
?>
<?php
function GetPLinks($links) {
global $cookie;
if (empty($cookie['user'])) stop
("Cookie not added, please add it.");
foreach ($links as $l) {
$l = "http://www.megaupload.com/?d=".$l;
$page = curl($l, "user={$cookie['user']};l=en;");
//if (stristr($page, $mystr))
if (stristr($page, "\r\nLocation:")){ if (!preg_match('@Location: (http://www\d+\.megaupload\.com/files/[^\r|\n]+)@i', $page, $rloc)) $rloc[1] = "$l - Unknown redirect found."; $ret[] = $rloc[1];
continue;
}
if (!stristr($page, 'flashvars.status = "premium"')) stop
("Account isn't premium or cookie is invalid."); if (stristr($page, 'password protected')) { $ret[] = "$l - Password?";continue;
}
if (stristr($page, 'the link you have clicked is not available')) { $ret[] = "$l - Link not found";continue;
}
if (stristr($page, 'The file you are trying to access is temporarily unavailable')) { $ret[] = "$l - Unavailable";continue;
}
if (!preg_match('@(http://www\d+\.megaupload\.com/files/[^/]+/[^"|\']+)@i', $page, $rloc)) { $ret[] = "$l - Download link not found";continue;
}
$ret[] = $rloc[1];
}
foreach ($ret as $l) {
}
}
?>
<?php
if (isset($_REQUEST['video_id'])) { // Get IDs
if ((!empty($_REQUEST['video_id'])) && (preg_match_all("/http:\/\/(?:www\.)?megaupload\.com\/(?:[a-z]{2}\/)?\?d=(?P<lnkID>[0-9a-zA-Z]{8})/i", $_REQUEST['video_id'], $matches))) { // Remove duplicated links
// Generate now
GetPLinks($links);
} else {
echo "No links found.";
}
}
?>
es para imprimirlo en mas de un sitio