login logout
This commit is contained in:
@@ -1,3 +0,0 @@
|
|||||||
<?php
|
|
||||||
define ( 'SQL_LOG', 1 ); // schreibt sql querys in eine log
|
|
||||||
?>
|
|
||||||
138
string.php
138
string.php
@@ -1,70 +1,70 @@
|
|||||||
<?php
|
<?php
|
||||||
function umlaute($str) {
|
function umlaute($str) {
|
||||||
return str_replace(array(
|
return str_replace(array(
|
||||||
'Ä',
|
'Ä',
|
||||||
'Ö',
|
'Ö',
|
||||||
'Ü',
|
'Ü',
|
||||||
'ä',
|
'ä',
|
||||||
'ö',
|
'ö',
|
||||||
'ü',
|
'ü',
|
||||||
'ß'
|
'ß'
|
||||||
), array(
|
), array(
|
||||||
'Ä',
|
'Ä',
|
||||||
'Ö',
|
'Ö',
|
||||||
'Ü',
|
'Ü',
|
||||||
'ä',
|
'ä',
|
||||||
'ö',
|
'ö',
|
||||||
'ü',
|
'ü',
|
||||||
'ß'
|
'ß'
|
||||||
), $str);
|
), $str);
|
||||||
}
|
}
|
||||||
function chk($str) {
|
function chk($str) {
|
||||||
return str_replace("'", '"', $str);
|
return str_replace("'", '"', $str);
|
||||||
}
|
}
|
||||||
function noScript($str) {
|
function noScript($str) {
|
||||||
return str_replace(array(
|
return str_replace(array(
|
||||||
'<',
|
'<',
|
||||||
'>'
|
'>'
|
||||||
), array(
|
), array(
|
||||||
'<',
|
'<',
|
||||||
'>'
|
'>'
|
||||||
), $str);
|
), $str);
|
||||||
}
|
}
|
||||||
function random($name_laenge) {
|
function random($name_laenge) {
|
||||||
$zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789";
|
$zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789";
|
||||||
$name_neu = "";
|
$name_neu = "";
|
||||||
|
|
||||||
@mt_srand((double)microtime() * 1000000);
|
@mt_srand((double)microtime() * 1000000);
|
||||||
for($i = 0; $i < $name_laenge; $i++){
|
for($i = 0; $i < $name_laenge; $i++){
|
||||||
$r = mt_rand(0, strlen($zeichen) - 1);
|
$r = mt_rand(0, strlen($zeichen) - 1);
|
||||||
$name_neu .= $zeichen{$r};
|
$name_neu .= $zeichen{$r};
|
||||||
}
|
}
|
||||||
return $name_neu;
|
return $name_neu;
|
||||||
}
|
}
|
||||||
function startsWith($haystack, $needle) {
|
function startsWith($haystack, $needle) {
|
||||||
$length = strlen($needle);
|
$length = strlen($needle);
|
||||||
return (substr($haystack, 0, $length) === $needle);
|
return (substr($haystack, 0, $length) === $needle);
|
||||||
}
|
}
|
||||||
function endsWith($haystack, $needle) {
|
function endsWith($haystack, $needle) {
|
||||||
$length = strlen($needle);
|
$length = strlen($needle);
|
||||||
|
|
||||||
return $length === 0 || (substr($haystack, -$length) === $needle);
|
return $length === 0 || (substr($haystack, -$length) === $needle);
|
||||||
}
|
}
|
||||||
function onlyAlpha($str) {
|
function onlyAlpha($str) {
|
||||||
return preg_replace("/[^a-zA-Z0-9 \-\_]+/", "", $str);
|
return preg_replace("/[^a-zA-Z0-9 \-\_]+/", "", $str);
|
||||||
}
|
}
|
||||||
function shortener($str, $len = 50, $fill = '...') {
|
function shortener($str, $len = 50, $fill = '...') {
|
||||||
if(strlen($str) > $len){
|
if(strlen($str) > $len){
|
||||||
$str = substr($str, 0, $len - strlen($fill)) . $fill;
|
$str = substr($str, 0, $len - strlen($fill)) . $fill;
|
||||||
}
|
}
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
function isEmail($str) {
|
function isEmail($str) {
|
||||||
$match = preg_match("/[a-zA-Z0-9\-\_\.]*\@[a-zA-Z0-9\-\_\.]*.[a-z]{2,10}/", $str);
|
$match = preg_match("/[a-zA-Z0-9\-\_\.]*\@[a-zA-Z0-9\-\_\.]*.[a-z]{2,10}/", $str);
|
||||||
if($match){
|
if($match){
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user