Revize 74a7dbca
Přidáno uživatelem Michal Kliment před více než 9 roky(ů)
application/helpers/text.php | ||
---|---|---|
* @author Ondřej Fibich
|
||
* @param string $str String
|
||
* @param string $start Start
|
||
* @param bool $icase Ignore case? [optional]
|
||
* @return bool true if first string starts with second
|
||
*/
|
||
public static function starts_with($str, $start)
|
||
public static function starts_with($str, $start, $icase = FALSE)
|
||
{
|
||
return strncmp($str, $start, mb_strlen($start)) == 0;
|
||
if ($icase === TRUE)
|
||
{
|
||
return strncasecmp($str, $start, mb_strlen($start)) == 0;
|
||
}
|
||
else
|
||
{
|
||
return strncmp($str, $start, mb_strlen($start)) == 0;
|
||
}
|
||
}
|
||
|
||
/**
|
Také k dispozici: Unified diff
Merge from SVN branch 1.2.