PHP Archiv

Das PHP Script Verzeichnis


Category Archives: Code Schnipsel und Klassen

Diese Funktion dient der Validierung eines Iban Codes function ValidIban($value) { $iban = false; $value= strtoupper(trim($value)); # Change US text into your country code if(preg_match(‚/^USd{7}0[A-Z0-9]{16}$/‘, $value)) { $number= substr($value,4,22).’2927′.substr($value,2,2); $number= str_replace( array(‚A‘,’B‘,’C‘,’D‘,’E‘,’F‘,’G‘,’H‘,’I‘,’J‘,’K‘,’L‘,’M‘,’N‘,’O‘,’P‘,’Q‘,’R‘,’S‘,’T‘,’U‘,’V‘,’W‘,’X‘,’Y‘,’Z‘), array(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35), $number ); // Iban var – $iban = (1 == bcmod($number,97)) ? true:false; } // Return to print return $iban; }[/php] Quelle: […]

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: */ // set URL to download curl_setopt($ch, CURLOPT_URL, $Url); // set referer: curl_setopt($ch, CURLOPT_REFERER, „“); // 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) […]