<?php
/**
* This is the dynamic loader for the library. It checks whether you have
* the mbstring extension available and includes relevant files
* on that basis, falling back to the native (as in written in PHP) version
* if mbstring is unavailabe.
*
* It's probably easiest to use this, if you don't want to understand
* the dependencies involved, in conjunction with PHP versions etc. At
* the same time, you might get better performance by managing loading
* yourself. The smartest way to do this, bearing in mind performance,
* is probably to "load on demand" - i.e. just before you use these
* functions in your code, load the version you need.
*
* It makes sure the the following functions are available;
* utf8_strlen, utf8_strpos, utf8_strrpos, utf8_substr,
* utf8_strtolower, utf8_strtoupper
* Other functions in the ./native directory depend on these
* six functions being available
* @package utf8
*/
/**
* Put the current directory in this constant
*/
if ( !defined('UTF8') ) {
define('UTF8',dirname(__FILE__));
}
/**
* If string overloading is active, it will break many of the
* native implementations. mbstring.func_overload must be set
* to 0, 1 or 4 in php.ini (string overloading disabled).
* Also need to check we have the correct internal mbstring
* encoding
*/
if ( extension_loaded('mbstring')) {
if ( ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING ) {
trigger_error('String functions are overloaded by mbstring',E_USER_ERROR);
}
mb_internal_encoding('UTF-8');
}
/**
* Check whether PCRE has been compiled with UTF-8 support
*/
$UTF8_ar = array();
if ( preg_match('/^.{1}$/u',"ñ",$UTF8_ar) != 1 ) {
trigger_error('PCRE is not compiled with UTF-8 support',E_USER_ERROR);
}
unset($UTF8_ar);
/**
* Load the smartest implementations of utf8_strpos, utf8_strrpos
* and utf8_substr
*/
if ( !defined('UTF8_CORE') ) {
if ( function_exists('mb_substr') ) {
require_once UTF8 . '/mbstring/core.php';
} else {
require_once UTF8 . '/utils/unicode.php';
require_once UTF8 . '/native/core.php';
}
}
/**
* Load the native implementation of utf8_substr_replace
*/
require_once UTF8 . '/substr_replace.php';
/**
* You should now be able to use all the other utf_* string functions
*/
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| mbstring/ | 2013-03-01 19:54 | 4.13 KB | 76129f60960:kunden | dxwrx-rx-r | |
| native/ | 2013-03-01 19:54 | 16.63 KB | 76129f60960:kunden | dxwrx-rx-r | |
| utils/ | 2013-03-01 19:54 | 52.66 KB | 76129f60960:kunden | dxwrx-rx-r | |
| LICENSE | 2013-03-01 19:53 | 25.81 KB | 76129f60960:kunden | -xw-x----- | |
| README | 2013-03-01 19:53 | 3.29 KB | 76129f60960:kunden | -xw-x----- | |
| index.html | 2013-03-01 19:53 | 31 B | 76129f60960:kunden | -xw-x----- | |
| ord.php | 2013-03-01 19:53 | 2.35 KB | 76129f60960:kunden | -xw-x----- | |
| str_ireplace.php | 2013-03-01 19:53 | 1.95 KB | 76129f60960:kunden | -xw-x----- | |
| str_pad.php | 2013-03-01 19:53 | 1.67 KB | 76129f60960:kunden | -xw-x----- | |
| str_split.php | 2013-03-01 19:53 | 824 B | 76129f60960:kunden | -xw-x----- | |
| strcasecmp.php | 2013-03-01 19:53 | 546 B | 76129f60960:kunden | -xw-x----- | |
| strcspn.php | 2013-03-01 19:53 | 894 B | 76129f60960:kunden | -xw-x----- | |
| stristr.php | 2013-03-01 19:53 | 855 B | 76129f60960:kunden | -xw-x----- | |
| strrev.php | 2013-03-01 19:53 | 458 B | 76129f60960:kunden | -xw-x----- | |
| strspn.php | 2013-03-01 19:53 | 923 B | 76129f60960:kunden | -xw-x----- | |
| substr_replace.php | 2013-03-01 19:53 | 600 B | 76129f60960:kunden | -xw-x----- | |
| trim.php | 2013-03-01 19:53 | 2.18 KB | 76129f60960:kunden | -xw-x----- | |
| ucfirst.php | 2013-03-01 19:53 | 787 B | 76129f60960:kunden | -xw-x----- | |
| ucwords.php | 2013-03-01 19:53 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| utf8.php | 2013-03-01 19:53 | 2.22 KB | 76129f60960:kunden | -xw-x----- | |