3 * Defines a set of specialized string functions.
5 * @package PhpMyAdmin-String
7 interface PMA_StringByte
10 * Returns length of string depending on current charset.
12 * @param string $string string to count
14 * @return int|false string length
17 public function strlen($string);
20 * Returns substring from string, works depending on current charset.
22 * @param string $string string to count
23 * @param int $start start of substring
24 * @param int $length length of substring
26 * @return string|false the sub string
28 public function substr($string, $start, $length = 2147483647);
31 * Returns number of substring from string, works depending on current charset.
33 * @param string $string string to check
34 * @param int $needle string to count
36 * @return int number of substring from the string
38 public function substrCount($string, $needle);
41 * Returns position of $needle in $haystack or false if not found
43 * @param string $haystack the string being checked
44 * @param string $needle the string to find in haystack
45 * @param int $offset the search offset
47 * @return int|false position of $needle in $haystack or false
49 public function strpos($haystack, $needle, $offset = 0);
52 * Returns position of $needle in $haystack - case insensitive - or false if
55 * @param string $haystack the string being checked
56 * @param string $needle the string to find in haystack
57 * @param int $offset the search offset
59 * @return int|false position of $needle in $haystack or false
61 public function stripos($haystack, $needle, $offset = 0);
64 * Returns position of last $needle in $haystack or false if not found
66 * @param string $haystack the string being checked
67 * @param string $needle the string to find in haystack
68 * @param int $offset the search offset
70 * @return int|false position of last $needle in $haystack or false
72 public function strrpos($haystack, $needle, $offset = 0);
75 * Returns position of last $needle in $haystack - case insensitive - or false
78 * @param string $haystack the string being checked
79 * @param string $needle the string to find in haystack
80 * @param int $offset the search offset
82 * @return int|false position of last $needle in $haystack or false
84 public function strripos($haystack, $needle, $offset = 0);
87 * Returns part of $haystack string starting from and including the first
88 * occurrence of $needle to the end of $haystack or false if not found
90 * @param string $haystack the string being checked
91 * @param string $needle the string to find in haystack
92 * @param bool $before_needle the part before the needle
94 * @return string|false part of $haystack or false
96 public function strstr($haystack, $needle, $before_needle = false);
99 * Returns part of $haystack string starting from and including the first
100 * occurrence of $needle to the end of $haystack - case insensitive - or false
103 * @param string $haystack the string being checked
104 * @param string $needle the string to find in haystack
105 * @param bool $before_needle the part before the needle
107 * @return string|false part of $haystack or false
110 * @see DON'T USE UNTIL HHVM IMPLEMENTS THIRD PARAMETER!
112 public function stristr($haystack, $needle, $before_needle = false);
115 * Returns the portion of haystack which starts at the last occurrence or false
118 * @param string $haystack the string being checked
119 * @param string $needle the string to find in haystack
121 * @return string|false portion of haystack which starts at the last occurrence
124 public function strrchr($haystack, $needle);
127 * Make a string lowercase
129 * @param string $string the string being lowercased
131 * @return string the lower case string
133 public function strtolower($string);
136 * Make a string uppercase
138 * @param string $string the string being uppercased
140 * @return string the lower case string
142 public function strtoupper($string);
145 * Returns position of $needle in $haystack from a regular expression match
147 * @param string $pattern Pattern to search for
148 * @param string $subject Input string
149 * @param int $offset Start from search
151 * @return int|false position of $needle in $haystack or false
153 public function pregStrpos($pattern, $subject, $offset = 0);
156 * Get the ordinal value of a string
158 * @param string $string the string for which ord is required
160 * @return string the ord value
162 public function ord($string);
165 * Get the character of an ASCII
167 * @param int $ascii the ASCII code for which character is required
169 * @return string the character
171 public function chr($ascii);