Manage PlItems

You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.

Advanced Search
Displaying 291-300 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
132PHPDateihandlingPrüfen ob Datei schreibbar ist// Orginal von: http://www.sebastianviereck.de/php-nicht-schreibbare-dateien-finden-und-beheben/ function checkFileWritable($file) { if(!file_exists($file)) { file_put_contents($file, ""); } if(!chmod($file, 0644)) { $fileowner = fileowner($file); echo "counld not change File Permissions: $file, File Owner is: $fileowner"; if(!chown($file, ftpUserID)) { echo "counld not change File owner: $file "; mail(mailadresse, "Schreibeprobleme","File: $file, File Owner is: $fileowner"); } } }View Update Delete
136PHPTextdateienTextdatei schreiben$datei = fopen("myfile.txt","w+"); // write rewind($datei); fwrite($datei, time()"); fclose($datei); View Update Delete
179PHPFilehandlingPrüfen ob Datei existiert$filePath = "/home/myUser/test.txt"; if (file_exists($filePath)) { echo "There it is! ;-)" } else { "Whow, file is missing at this place :-(" }View Update Delete
187PHPURL-HandlingAktuelle URL bekommen// https://myDomain/appPath/index.php $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $domainName = $_SERVER['HTTP_HOST']; $query = $_SERVER['PHP_SELF']; $path = pathinfo( $query ); $myURLBasePath=$protocol.$domainName.$path['dirname']; echo $myURLBasePath; // https://myDomain/appPath echo $myURLBasePath.'/'.$path['basename']; // https://myDomain/appPath/index.phpView Update Delete
202PHPFallunterscheidungTernary operator$testVar = "OK"; $resultVar; $resultVar = $testVar=="OK" ? true : false; // same as if-else construction if ($testVar == "OK") { $resultVar = true; } else { $resultVar = false; };View Update Delete
224PHPStringsReplace// http://php.net/manual/de/function.str-replace.php $str1 = "abc#def"; $str1 = str_replace("#",";",$str1); echo $str1; # Output: abc;defView Update Delete
225PHPSysteminfoHostnamen ermittelnecho gethostname(); // prints myComputer1 or srvLinux1View Update Delete
238PHPStringsString auf Wunschlänge zuschneiden// http://php.net/manual/de/function.substr.php $myString = "Benzinverbrauch"; echo substr($myString,2,8); //Ausgabe: "nzinverb"View Update Delete
239PHPStringsText in Großschrift oder Kleinschrift//http://us2.php.net/manual/de/function.strtoupper.php $myString = "my lovely Mr Singing Club"; echo strtoupper($myString); // MY LOVELY MR SINGING CLUB //http://php.net/manual/de/function.strtolower.php echo strtolower($myString);View Update Delete
250PHPStringsErster Buchstable Groß in Wort$myString = "nothingspecial"; $uc = ucwords($myString); echo $uc; // NothingspecialView Update Delete