PHP Archiv

Das PHP Script Verzeichnis

Tag Archives: Code

Die Color inverse Funktion invertiert eine Farbe. Zum Beispiel schwarz in weiß, blau in gelb usw. function color_inverse($color){ $color = str_replace(‚#‘, “, $color); if (strlen($color) != 6){ return ‚000000‘; } $rgb = “; for ($x=0;$x<3;$x++){ $c = 255 – hexdec(substr($color,(2*$x),2)); $c = ($c < 0) ? 0 : dechex($c); $rgb .= (strlen($c) < 2) ? […]

Die kleine Routine führt ein Update des Copyright Datums durch function autoUpdatingCopyright($startYear){ // given start year (e.g. 2004) $startYear = intval($startYear); // current year (e.g. 2007) $year = intval(date(‚Y‘)); // is the current year greater than the // given start year? if ($year > $startYear) return $startYear .‘-‚. $year; else return $startYear; } [/php] Quelle: […]

Mit der PHP Funktion kann man tägliche, wöchentliche usw. Zufalls Quotes einblenden. 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 […]