????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.148.226.67 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_ereg_replace() function : basic --SKIPIF-- <?php extension_loaded('mbstring') or die('skip'); function_exists('mb_ereg_replace') or die("skip mb_ereg_replace() is not available in this build"); ?> --FILE-- <?php /* Prototype : string mb_ereg_replace(string $pattern, string $replacement, * string $string [, string o$ption]) * Description: Replace regular expression for multibyte string * Source code: ext/mbstring/php_mbregex.c */ /* * Test Basic Functionality of mb_ereg_replace() */ echo "*** Testing mb_ereg_replace() : basic functionality ***\n"; mb_internal_encoding('UTF-8'); mb_regex_encoding('UTF-8'); $string_ascii = b'abc def'; $string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII='); echo "\n-- ASCII string 1 --\n"; $result_1 = mb_ereg_replace(b'(.*)def', b'\\1 123', $string_ascii); var_dump(bin2hex($result_1)); echo "\n-- ASCII string 2 --\n"; $result_2 = mb_ereg_replace(b'123', b'abc', $string_ascii); var_dump(bin2hex($result_2)); echo "\n-- Multibyte string 1 --\n"; $regex1 = base64_decode('KOaXpeacrOiqnikuKj8oWzEtOV0rKQ=='); //Japanese regex in UTF-8 $result_3 = mb_ereg_replace($regex1, b'\\1_____\\2', $string_mb); var_dump(bin2hex($result_3)); echo "\n-- Multibyte string 2 --\n"; $regex2 = base64_decode('5LiW55WM'); $result_4 = mb_ereg_replace($regex2, b'_____', $string_mb); var_dump(bin2hex($result_4)); echo "Done"; ?> --EXPECT-- *** Testing mb_ereg_replace() : basic functionality *** -- ASCII string 1 -- string(16) "6162632020313233" -- ASCII string 2 -- string(14) "61626320646566" -- Multibyte string 1 -- string(72) "e697a5e69cace8aa9e5f5f5f5f5f31323334efbc95efbc96efbc97efbc98efbc99e38082" -- Multibyte string 2 -- string(106) "e697a5e69cace8aa9ee38386e382ade382b9e38388e381a7e38199e380823031323334efbc95efbc96efbc97efbc98efbc99e38082" Done