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


PHP Multibyte::strrpos方法代码示例

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


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

示例1: testMultibyteStrrpos

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

示例2: mb_strrpos

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


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