Mit diesem Code kann man die Zeit, die PHP auf eine MySQL Verbindung wartet einstellen.
Mit diesem Code kann man die Zeit, die PHP auf eine MySQL Verbindung wartet einstellen.
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? […]
Diese Funktion zeigt täglich wechselnden Zufallstext an. function RandomQuoteByInterval($TimeBase, $QuotesArray){ // Make sure it is a integer $TimeBase = intval($TimeBase); // How many items are in the array? $ItemCount = count($QuotesArray); // By using the modulus operator we get a pseudo // random index position that is between zero and the // maximal value (ItemCount) […]
Standartmäßig wartet PHP 60 Sekunden um eine MySQL Verbindung (timeout) zu beenden. Mit dem folgenden Code Shippet läßt sich die Wartezeit frei anpassen.