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


PHP Multibyte::stripos方法代码示例

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


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

示例1: testMultibyteStripos

 /**
  * testMultibyteStripos method
  *
  * @return void
  */
 public function testMultibyteStripos()
 {
     $string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
     $find = 'f';
     $result = Multibyte::stripos($string, $find);
     $expected = 5;
     $this->assertEquals($expected, $result);
     $string = 'ABCDEFGHIJKLMNOPQFRSTUVWXYZ0123456789';
     $find = 'f';
     $result = Multibyte::stripos($string, $find, 6);
     $expected = 17;
     $this->assertEquals($expected, $result);
     $string = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';
     $find = 'å';
     $result = Multibyte::stripos($string, $find);
     $expected = 5;
     $this->assertEquals($expected, $result);
     $string = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÅÙÚÛÜÝÞ';
     $find = 'å';
     $result = Multibyte::stripos($string, $find, 6);
     $expected = 24;
     $this->assertEquals($expected, $result);
     $string = 'ĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŹŻŽ';
     $find = 'ċ';
     $result = Multibyte::stripos($string, $find);
     $expected = 5;
     $this->assertEquals($expected, $result);
     $string = 'ĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮIJĴĶĹĻĽĿŁĊŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŹŻŽ';
     $find = 'ċ';
     $result = Multibyte::stripos($string, $find, 6);
     $expected = 32;
     $this->assertEquals($expected, $result);
     $string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
     $find = 'f';
     $result = Multibyte::stripos($string, $find);
     $expected = 37;
     $this->assertEquals($expected, $result);
     $string = '¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈ';
     $find = 'Μ';
     $result = Multibyte::stripos($string, $find);
     $expected = 20;
     $this->assertEquals($expected, $result);
     $string = 'ÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬ';
     $find = 'É';
     $result = Multibyte::stripos($string, $find, 6);
     $expected = 32;
     $this->assertEquals($expected, $result);
     $string = 'ĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐ';
     $find = 'Ņ';
     $result = Multibyte::stripos($string, $find);
     $expected = 24;
     $this->assertEquals($expected, $result);
     $string = 'ƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴ';
     $find = 'Ƹ';
     $result = Multibyte::stripos($string, $find);
     $expected = 39;
     $this->assertEquals($expected, $result);
     $string = 'ƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴ';
     $find = 'Ƹ';
     $result = Multibyte::stripos($string, $find, 40);
     $expected = 40;
     $this->assertEquals($expected, $result);
     $string = 'əɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʼ';
     $find = 'Ʀ';
     $result = Multibyte::stripos($string, $find);
     $expected = 39;
     $this->assertEquals($expected, $result);
     $string = 'ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛ';
     $find = 'ї';
     $result = Multibyte::stripos($string, $find);
     $expected = 7;
     $this->assertEquals($expected, $result);
     $string = 'МНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыь';
     $find = 'Р';
     $result = Multibyte::stripos($string, $find);
     $expected = 4;
     $this->assertEquals($expected, $result);
     $string = 'МНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыь';
     $find = 'Р';
     $result = Multibyte::stripos($string, $find, 5);
     $expected = 36;
     $this->assertEquals($expected, $result);
     $string = 'فقكلمنهوىيًٌٍَُ';
     $find = 'ن';
     $result = Multibyte::stripos($string, $find);
     $expected = 5;
     $this->assertEquals($expected, $result);
     $string = '✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃❄❅❆❇❈❉❊❋❌❍❎❏❐❑❒❓❔❕❖❗❘❙❚❛❜❝❞';
     $find = '✿';
     $result = Multibyte::stripos($string, $find);
     $expected = 15;
     $this->assertEquals($expected, $result);
     $string = '⺀⺁⺂⺃⺄⺅⺆⺇⺈⺉⺊⺋⺌⺍⺎⺏⺐⺑⺒⺓⺔⺕⺖⺗⺘⺙⺛⺜⺝⺞⺟⺠⺡⺢⺣⺤⺥⺦⺧⺨⺩⺪⺫⺬⺭⺮⺯⺰⺱⺲⺳⺴⺵⺶⺷⺸⺹⺺⺻⺼⺽⺾⺿⻀⻁⻂⻃⻄⻅⻆⻇⻈⻉⻊⻋⻌⻍⻎⻏⻐⻑⻒⻓⻔⻕⻖⻗⻘⻙⻚⻛⻜⻝⻞⻟⻠';
     $find = '⺐';
     $result = Multibyte::stripos($string, $find);
//.........这里部分代码省略.........
开发者ID:mrbadao,项目名称:api-official,代码行数:101,代码来源:MultibyteTest.php

示例2: mb_stripos

 function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
 {
     return Multibyte::stripos($haystack, $needle, $offset);
 }
开发者ID:cls1991,项目名称:ryzomcore,代码行数:4,代码来源:multibyte.php


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