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