PHP Archiv

Das PHP Script Verzeichnis

Werbung

Tag Archives: Code

Tausch von zwei Variablen ohne Nutzung einer temporären Variable // Test variables $a = „content a“; $b = „content b“; // Swap $a and $b list($a, $b) = array($b, $a); // Debug print print „variable a: $an“; print „variable b: $bn“; /* Output: variable a: content b variable b: content a */[/php] Quelle: jonasjohn.de

function DownloadUrl($Url){ // is curl installed? if (!function_exists(‚curl_init‘)){ die(‚CURL is not installed!‘); } // create a new curl resource $ch = curl_init(); /* Here you find more options for curl: http://www.php.net/curl_setopt */ // set URL to download curl_setopt($ch, CURLOPT_URL, $Url); // set referer: curl_setopt($ch, CURLOPT_REFERER, „http://www.google.com/“); // user agent: curl_setopt($ch, CURLOPT_USERAGENT, „MozillaXYZ/1.0“); // remove header? […]