开发者

php extension: how do I use the mb_* functions

There's a lot of functionality available in PHP for scripts. Is this functionality available somehow to the extension writer? I'd reall开发者_JAVA百科y like to use the multibyte functions but can't find an example thereof.


You can take the exif module as an example. It also depends on the mbstring module and calls its functions "directly", i.e. without something like call_user_function_ex(...)

e.g.

ZEND_INI_MH(OnUpdateEncode)
{
#if EXIF_USE_MBSTRING
    if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
        return FAILURE;
    }
#endif
    return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜