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


PHP Multibyte::strlen方法代码示例

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


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

示例1: testMultibyteStrlen

 /**
  * testMultibyteStrlen method
  *
  * @return void
  */
 public function testMultibyteStrlen()
 {
     $string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
     $result = Multibyte::strlen($string);
     $expected = 36;
     $this->assertEquals($expected, $result);
     $string = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';
     $result = Multibyte::strlen($string);
     $expected = 30;
     $this->assertEquals($expected, $result);
     $string = 'ĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŹŻŽ';
     $result = Multibyte::strlen($string);
     $expected = 61;
     $this->assertEquals($expected, $result);
     $string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
     $result = Multibyte::strlen($string);
     $expected = 94;
     $this->assertEquals($expected, $result);
     $string = '¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈ';
     $result = Multibyte::strlen($string);
     $expected = 40;
     $this->assertEquals($expected, $result);
     $string = 'ÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬ';
     $result = Multibyte::strlen($string);
     $expected = 100;
     $this->assertEquals($expected, $result);
     $string = 'ĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐ';
     $result = Multibyte::strlen($string);
     $expected = 100;
     $this->assertEquals($expected, $result);
     $string = 'ƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴ';
     $result = Multibyte::strlen($string);
     $expected = 100;
     $this->assertEquals($expected, $result);
     $string = 'əɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʼ';
     $result = Multibyte::strlen($string);
     $expected = 100;
     $this->assertEquals($expected, $result);
     $string = 'ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛ';
     $result = Multibyte::strlen($string);
     $expected = 28;
     $this->assertEquals($expected, $result);
     $string = 'МНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыь';
     $result = Multibyte::strlen($string);
     $expected = 49;
     $this->assertEquals($expected, $result);
     $string = 'فقكلمنهوىيًٌٍَُ';
     $result = Multibyte::strlen($string);
     $expected = 15;
     $this->assertEquals($expected, $result);
     $string = '✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃❄❅❆❇❈❉❊❋❌❍❎❏❐❑❒❓❔❕❖❗❘❙❚❛❜❝❞';
     $result = Multibyte::strlen($string);
     $expected = 47;
     $this->assertEquals($expected, $result);
     $string = '⺀⺁⺂⺃⺄⺅⺆⺇⺈⺉⺊⺋⺌⺍⺎⺏⺐⺑⺒⺓⺔⺕⺖⺗⺘⺙⺛⺜⺝⺞⺟⺠⺡⺢⺣⺤⺥⺦⺧⺨⺩⺪⺫⺬⺭⺮⺯⺰⺱⺲⺳⺴⺵⺶⺷⺸⺹⺺⺻⺼⺽⺾⺿⻀⻁⻂⻃⻄⻅⻆⻇⻈⻉⻊⻋⻌⻍⻎⻏⻐⻑⻒⻓⻔⻕⻖⻗⻘⻙⻚⻛⻜⻝⻞⻟⻠';
     $result = Multibyte::strlen($string);
     $expected = 96;
     $this->assertEquals($expected, $result);
     $string = '⽅⽆⽇⽈⽉⽊⽋⽌⽍⽎⽏⽐⽑⽒⽓⽔⽕⽖⽗⽘⽙⽚⽛⽜⽝⽞⽟⽠⽡⽢⽣⽤⽥⽦⽧⽨⽩⽪⽫⽬⽭⽮⽯⽰⽱⽲⽳⽴⽵⽶⽷⽸⽹⽺⽻⽼⽽⽾⽿';
     $result = Multibyte::strlen($string);
     $expected = 59;
     $this->assertEquals($expected, $result);
     $string = '눡눢눣눤눥눦눧눨눩눪눫눬눭눮눯눰눱눲눳눴눵눶눷눸눹눺눻눼눽눾눿뉀뉁뉂뉃뉄뉅뉆뉇뉈뉉뉊뉋뉌뉍뉎뉏뉐뉑뉒뉓뉔뉕뉖뉗뉘뉙뉚뉛뉜뉝뉞뉟뉠뉡뉢뉣뉤뉥뉦뉧뉨뉩뉪뉫뉬뉭뉮뉯뉰뉱뉲뉳뉴뉵뉶뉷뉸뉹뉺뉻뉼뉽뉾뉿늀늁늂늃늄';
     $result = Multibyte::strlen($string);
     $expected = 100;
     $this->assertEquals($expected, $result);
     $string = 'ﹰﹱﹲﹳﹴ﹵ﹶﹷﹸﹹﹺﹻﹼﹽﹾﹿﺀﺁﺂﺃﺄﺅﺆﺇﺈﺉﺊﺋﺌﺍﺎﺏﺐﺑﺒﺓﺔﺕﺖﺗﺘﺙﺚﺛﺜﺝﺞﺟﺠﺡﺢﺣﺤﺥﺦﺧﺨﺩﺪﺫﺬﺭﺮﺯﺰ';
     $result = Multibyte::strlen($string);
     $expected = 65;
     $this->assertEquals($expected, $result);
     $string = 'ﺱﺲﺳﺴﺵﺶﺷﺸﺹﺺﺻﺼﺽﺾﺿﻀﻁﻂﻃﻄﻅﻆﻇﻈﻉﻊﻋﻌﻍﻎﻏﻐﻑﻒﻓﻔﻕﻖﻗﻘﻙﻚﻛﻜﻝﻞﻟﻠﻡﻢﻣﻤﻥﻦﻧﻨﻩﻪﻫﻬﻭﻮﻯﻰﻱﻲﻳﻴﻵﻶﻷﻸﻹﻺﻻﻼ';
     $result = Multibyte::strlen($string);
     $expected = 76;
     $this->assertEquals($expected, $result);
     $string = 'abcdefghijklmnopqrstuvwxyz';
     $result = Multibyte::strlen($string);
     $expected = 26;
     $this->assertEquals($expected, $result);
     $string = '。「」、・ヲァィゥェォャュョッーアイウエオカキク';
     $result = Multibyte::strlen($string);
     $expected = 24;
     $this->assertEquals($expected, $result);
     $string = 'ケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙';
     $result = Multibyte::strlen($string);
     $expected = 38;
     $this->assertEquals($expected, $result);
     $string = 'Ĥēĺļŏ, Ŵőřļď!';
     $result = Multibyte::strlen($string);
     $expected = 13;
     $this->assertEquals($expected, $result);
     $string = 'Hello, World!';
     $result = Multibyte::strlen($string);
     $expected = 13;
     $this->assertEquals($expected, $result);
     $string = 'čini';
//.........这里部分代码省略.........
开发者ID:mrbadao,项目名称:api-official,代码行数:101,代码来源:MultibyteTest.php

示例2: mb_strlen

 function mb_strlen($string, $encoding = null)
 {
     return Multibyte::strlen($string);
 }
开发者ID:cls1991,项目名称:ryzomcore,代码行数:4,代码来源:multibyte.php


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