2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Implements PMA_StringByte interface using native PHP functions.
6 * @package PhpMyAdmin-String
9 if (! defined('PHPMYADMIN')) {
13 require_once 'libraries/StringByte.int.php';
16 * Implements PMA_StringByte interface using native PHP functions.
18 * @package PhpMyAdmin-String
21 class PMA_StringNative
implements PMA_StringByte
24 * Returns length of string depending on current charset.
26 * @param string $string string to count
28 * @return int string length
30 public function strlen($string)
32 return strlen($string);
36 * Returns substring from string, works depending on current charset.
38 * @param string $string string to count
39 * @param int $start start of substring
40 * @param int $length length of substring
42 * @return string the sub string
44 public function substr($string, $start, $length = 2147483647)
46 return substr($string, $start, $length);
50 * Returns postion of $needle in $haystack or false if not found
52 * @param string $haystack the string being checked
53 * @param string $needle the string to find in haystack
54 * @param int $offset the search offset
56 * @return integer position of $needle in $haystack or false
58 public function strpos($haystack, $needle, $offset = 0)
60 return strpos($haystack, $needle, $offset);
64 * Make a string lowercase
66 * @param string $string the string being lowercased
68 * @return string the lower case string
70 public function strtolower($string)
72 return strtolower($string);
76 * Get the ordinal value of a string
78 * @param string $string the string for which ord is required
80 * @return string the ord value
82 public function ord($string)