????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.21.35.68 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/mbstring/tests/ |
Upload File : |
--TEST-- Test mb_stripos() function : basic functionality --SKIPIF-- <?php extension_loaded('mbstring') or die('skip'); function_exists('mb_stripos') or die("skip mb_stripos() is not available in this build"); ?> --FILE-- <?php /* Prototype : int mb_stripos(string haystack, string needle [, int offset [, string encoding]]) * Description: Finds position of first occurrence of a string within another, case insensitive * Source code: ext/mbstring/mbstring.c * Alias to functions: */ /* * Test basic functionality of mb_stripos with ASCII and multibyte characters */ echo "*** Testing mb_stripos() : basic functionality***\n"; mb_internal_encoding('UTF-8'); //ascii strings $ascii_haystacks = array( b'abc defabc def', b'ABC DEFABC DEF', b'Abc dEFaBC Def', ); $ascii_needles = array( // 4 good ones b'DE', b'de', b'De', b'dE', ); //greek strings in UTF-8 $greek_lower = base64_decode('zrrOu868zr3Ovs6/z4DPgSDOus67zrzOvc6+zr/PgA=='); $greek_upper = base64_decode('zprOm86czp3Ons6fzqDOoSDOms6bzpzOnc6ezp/OoA=='); $greek_mixed = base64_decode('zrrOu868zr3Ovs6fzqDOoSDOus67zpzOnc6+zr/OoA=='); $greek_haystacks = array($greek_lower, $greek_upper, $greek_mixed); $greek_nlower = base64_decode('zrzOvc6+zr8='); $greek_nupper = base64_decode('zpzOnc6ezp8='); $greek_nmixed1 = base64_decode('zpzOnc6+zr8='); $greek_nmixed2 = base64_decode('zrzOvc6+zp8='); $greek_needles = array( // 4 good ones $greek_nlower, $greek_nupper, $greek_nmixed1, $greek_nmixed2, ); // try the basic options echo "\n -- ASCII Strings --\n"; foreach ($ascii_needles as $needle) { foreach ($ascii_haystacks as $haystack) { var_dump(mb_stripos($haystack, $needle)); var_dump(mb_stripos($haystack, $needle, 6)); } } echo "\n -- Greek Strings --\n"; foreach ($greek_needles as $needle) { foreach ($greek_haystacks as $haystack) { var_dump(mb_stripos($haystack, $needle)); var_dump(mb_stripos($haystack, $needle, 4)); } } echo "Done"; ?> --EXPECTF-- *** Testing mb_stripos() : basic functionality*** -- ASCII Strings -- int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) int(4) int(13) -- Greek Strings -- int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) int(2) int(11) Done