Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 class ilStr
00034 {
00035 function subStr($a_str, $a_start, $a_length = NULL)
00036 {
00037 if (function_exists("mb_substr"))
00038 {
00039 return mb_substr($a_str, $a_start, $a_length, "UTF-8");
00040 }
00041 else
00042 {
00043 return substr($a_str, $a_start, $a_length);
00044 }
00045 }
00046
00047 function strPos($a_haystack, $a_needle, $a_offset = NULL)
00048 {
00049 if (function_exists("mb_strpos"))
00050 {
00051 return mb_strpos($a_haystack, $a_needle, $a_offset, "UTF-8");
00052 }
00053 else
00054 {
00055 return strpos($a_haystack, $a_needle, $a_offset);
00056 }
00057 }
00058
00059 function strLen($a_string)
00060 {
00061 if (function_exists("mb_strlen"))
00062 {
00063 return mb_strlen($a_string, "UTF-8");
00064 }
00065 else
00066 {
00067 return strlen($a_string);
00068 }
00069 }
00070
00071 function strToLower($a_string)
00072 {
00073 if (function_exists("mb_strtolower"))
00074 {
00075 return mb_strtolower($a_string, "UTF-8");
00076 }
00077 else
00078 {
00079 return strtolower($a_string);
00080 }
00081 }
00082
00083 function strToUpper($a_string)
00084 {
00085 if (function_exists("mb_strtoupper"))
00086 {
00087 return mb_strtoupper($a_string, "UTF-8");
00088 }
00089 else
00090 {
00091 return strtoupper($a_string);
00092 }
00093 }
00094
00095 }
00096 ?>