当前位置: 首页>>代码示例>>PHP>>正文


PHP UTF8::server_utf8方法代码示例

本文整理汇总了PHP中UTF8::server_utf8方法的典型用法代码示例。如果您正苦于以下问题:PHP UTF8::server_utf8方法的具体用法?PHP UTF8::server_utf8怎么用?PHP UTF8::server_utf8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UTF8的用法示例。


在下文中一共展示了UTF8::server_utf8方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set_value

    public static function set_value($object, $key, $value)
    {
        if (!isset(UTF8::$called[__FUNCTION__])) {
            require JsonApiApplication::find_file("utf8", __FUNCTION__);
            // Function has been called
            UTF8::$called[__FUNCTION__] = TRUE;
        }
        return _set_value($object, $key, $value);
    }
    public static function get_value($sender, $key)
    {
        if (!isset(UTF8::$called[__FUNCTION__])) {
            require JsonApiApplication::find_file("utf8", __FUNCTION__);
            // Function has been called
            UTF8::$called[__FUNCTION__] = TRUE;
        }
        return _get_value($sender, $key);
    }
    public static function gen_mt_rand()
    {
        if (!isset(UTF8::$called[__FUNCTION__])) {
            require JsonApiApplication::find_file("utf8", __FUNCTION__);
            // Function has been called
            UTF8::$called[__FUNCTION__] = TRUE;
        }
        return _gen_mt_rand();
    }
}
if (UTF8::$server_utf8 === NULL) {
    UTF8::$server_utf8 = extension_loaded("mbstring");
}
开发者ID:benshez,项目名称:DreamWeddingCeremonies,代码行数:31,代码来源:UTF8.php

示例2: test_strtoupper

 /**
  * Tests UTF8::strtoupper
  *
  * @test
  * @dataProvider provider_strtoupper
  */
 public function test_strtoupper($input, $expected)
 {
     $this->assertSame($expected, UTF8::strtoupper($input));
     UTF8::$server_utf8 = !UTF8::$server_utf8;
     $this->assertSame($expected, UTF8::strtoupper($input));
     UTF8::$server_utf8 = !UTF8::$server_utf8;
 }
开发者ID:azuya,项目名称:Wi3,代码行数:13,代码来源:UTF8Test.php

示例3: from_unicode

     * Takes an array of ints representing the Unicode characters and returns a UTF-8 string.
     * Astral planes are supported i.e. the ints in the input can be > 0xFFFF.
     * Occurrances of the BOM are ignored. Surrogates are not allowed.
     *
     *     $str = UTF8::to_unicode($array);
     *
     * The Original Code is Mozilla Communicator client code.
     * The Initial Developer of the Original Code is Netscape Communications Corporation.
     * Portions created by the Initial Developer are Copyright (C) 1998 the Initial Developer.
     * Ported to PHP by Henri Sivonen <hsivonen@iki.fi>, see http://hsivonen.iki.fi/php-utf8/
     * Slight modifications to fit with phputf8 library by Harry Fuecks <hfuecks@gmail.com>.
     *
     * @param   array    unicode code points representing a string
     * @return  string   utf8 string of characters
     * @return  boolean  FALSE if a code point cannot be found
     */
    public static function from_unicode($arr)
    {
        if (!isset(self::$called[__FUNCTION__])) {
            require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT;
            // Function has been called
            self::$called[__FUNCTION__] = TRUE;
        }
        return _from_unicode($arr);
    }
}
// End UTF8
if (UTF8::$server_utf8 === NULL) {
    // Determine if this server supports UTF-8 natively
    UTF8::$server_utf8 = extension_loaded('mbstring');
}
开发者ID:nguyendvphp,项目名称:onlinetraining,代码行数:31,代码来源:UTF8.php


注:本文中的UTF8::server_utf8方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。