ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilStr.php
Go to the documentation of this file.
1 <?php
2 /*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2005 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22 */
23 
24 
32 class ilStr
33 {
34  function subStr($a_str, $a_start, $a_length = NULL)
35  {
36  if (function_exists("mb_substr"))
37  {
38  return mb_substr($a_str, $a_start, $a_length, "UTF-8");
39  }
40  else
41  {
42  return substr($a_str, $a_start, $a_length);
43  }
44  }
45 
46  function strPos($a_haystack, $a_needle, $a_offset = NULL)
47  {
48  if (function_exists("mb_strpos"))
49  {
50  return mb_strpos($a_haystack, $a_needle, $a_offset, "UTF-8");
51  }
52  else
53  {
54  return strpos($a_haystack, $a_needle, $a_offset);
55  }
56  }
57 
58  function strLen($a_string)
59  {
60  if (function_exists("mb_strlen"))
61  {
62  return mb_strlen($a_string, "UTF-8");
63  }
64  else
65  {
66  return strlen($a_string);
67  }
68  }
69 
70  function strToLower($a_string)
71  {
72  if (function_exists("mb_strtolower"))
73  {
74  return mb_strtolower($a_string, "UTF-8");
75  }
76  else
77  {
78  return strtolower($a_string);
79  }
80  }
81 
82  function strToUpper($a_string)
83  {
84  if (function_exists("mb_strtoupper"))
85  {
86  return mb_strtoupper($a_string, "UTF-8");
87  }
88  else
89  {
90  return strtoupper($a_string);
91  }
92  }
93 
94 } // END class.ilUtil
95 ?>