This commit is contained in:
stubbfel
2013-06-27 10:55:07 +02:00
parent c03db748bc
commit 98b83dbfe3
15 changed files with 78 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
<?php
namespace utiliy;
include_once "../../global.inc.php";
@@ -9,36 +10,34 @@ include_once "../../global.inc.php";
* @since 25.06.2013
*/
class StringManager {
/**
* A Constant vor an emptystring like \"\"
* A Constant vor an emptystring like ""
* @var string
*/
public static $emptyString = "";
/**
* Method check if a certain string start with a certain sustring
* Method check if a certain string start with a certain substring
* @param string $haystack
* @param string $needle
* @return boolean
*/
public static function startsWith($haystack, $needle) {
public static function startsWith($haystack, $needle) {
return !strncmp($haystack, $needle, strlen($needle));
}
/**
* Method check if a certain string end with a certain sustring
* Method check if a certain string end with a certain substring
* @param string $haystack
* @param string $needle
* @return boolean
*/
public static function endsWith($haystack, $needle) {
public static function endsWith($haystack, $needle) {
return (substr($haystack, -strlen($needle)) === $needle);
}
/**
/**
* Method if the string is not a empty String (not only spaces and controlls)
* @param string $string
* @return boolean
@@ -49,6 +48,7 @@ class StringManager {
}
return FALSE;
}
}
?>