finish #64
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user