Translation update done using Pootle.
[phpmyadmin/dkf.git] / libraries / string_native.lib.php
blob8a5b8cc783df2dfd74a13694fb307d6e9357cd0e
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
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
11 * (that are slower).
13 * The SQL Parser code relies heavily on these functions.
15 * @version $Id$
16 * @package phpMyAdmin-String-Native
19 /**
20 * Returns length of string depending on current charset.
22 * @uses strlen()
23 * @param string string to count
24 * @return int string length
25 * @access public
26 * @todo rename to PM_STR_len()
28 function PMA_strlen($string)
30 return strlen($string);
33 /**
34 * Returns substring from string, works depending on current charset.
36 * @uses substr()
37 * @param string string to count
38 * @param int start of substring
39 * @param int length of substring
40 * @return int substring
41 * @access public
42 * @todo rename to PM_STR_sub()
44 function PMA_substr($string, $start, $length = 2147483647)
46 return substr($string, $start, $length);
49 /**
50 * returns postion of $needle in $haystack or false if not found
52 * @uses strpos()
53 * @param string $needle
54 * @param string $haystack
55 * @return integer position of $needle in $haystack or false
57 function PMA_STR_pos($haystack, $needle, $offset = 0)
59 return strpos($haystack, $needle, $offset);
62 /**
63 * returns right most postion of $needle in $haystack or false if not found
65 * @uses strrpos()
66 * @param string $needle
67 * @param string $haystack
68 * @return integer position of $needle in $haystack or false
70 function PMA_STR_rPos($haystack, $needle, $offset = 0)
72 return strrpos($haystack, $needle, $offset);