2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Specialized String Functions for phpMyAdmin
6 * Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
7 * http://www.orbis-terrarum.net/?l=people.robbat2
9 * Defines a set of function callbacks that have a pure C version available if
10 * the "ctype" extension is available, but otherwise have PHP versions to use
13 * The SQL Parser code relies heavily on these functions.
15 * @package PhpMyAdmin-String-MB
19 * Returns length of string depending on current charset.
21 * @param string string to count
22 * @return int string length
24 function PMA_strlen($string)
26 return mb_strlen($string);
30 * Returns substring from string, works depending on current charset.
32 * @param string $string string to count
33 * @param int $start start of substring
34 * @param int $length length of substring
37 function PMA_substr($string, $start, $length = 2147483647)
39 return mb_substr($string, $start, $length);
43 * Returns postion of $needle in $haystack or false if not found
45 * @param string $haystack
46 * @param string $needle
48 * @return integer position of $needle in $haystack or false
50 function PMA_strpos($haystack, $needle, $offset = 0)
52 return mb_strpos($haystack, $needle, $offset);
56 * Make a string lowercase
58 * @param string $string
61 function PMA_strtolower($string)
63 return mb_strtolower($string);