本文整理汇总了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';
//.........这里部分代码省略.........
示例2: mb_strlen
function mb_strlen($string, $encoding = null)
{
return Multibyte::strlen($string);
}