문제

There's a lot of functionality available in PHP for scripts. Is this functionality available somehow to the extension writer? I'd really 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);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top