SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 49 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

Applications that
are Unicode unaware are therefore able to handle many UTF-8 strings.
One such application that is not Unicode aware is PHP. We therefore have to be
careful when manipulating strings. PHP assumes all characters are eight bits (one
byte), but because UTF-8 encoded characters can be longer, this can cause corruption
of Unicode data.
There is a PHP module, mbstring, which adds support for multi-byte character
encodings; unfortunately, not all PHP systems have the mbstring module. In
Joomla! we are provided with the static JString class; this class allows us to perform
many of the normal string manipulation functions with UTF-8 characters.
This example demonstrates how we can use JString to convert a string to upper case.
Note that the method name is identical to the PHP function we would normally use:
$string = JString::strtoupper($string);
The following table describes the PHP string functions and the corresponding
JString methods:
PHP Function JString method Description
strpos strpos Finds the first occurrence of a string in a string.


Pages:
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6