????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.144.115.82 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/standard/tests/strings/ |
Upload File : |
--TEST-- Test chunk_split() function : usage variations - different double quoted values for 'str' argument --FILE-- <?php /* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]]) * Description: Returns split line * Source code: ext/standard/string.c * Alias to functions: none */ /* * Passing different double quoted strings for 'str' argument to chunk_split() * here 'chunklen' is set to 5 and 'ending' is "????" */ echo "*** Testing chunk_split() : with different double quoted values for 'str' argument ***\n"; // Initializing variables $chunklen = 5; $ending = "????"; // different values for 'str' $values = array( "", //empty " ", //space "This is simple string", //regular string "It's string with quotes", //string containing single quote "This contains @ # $ % ^ & chars", //string with special characters "This string\tcontains\rwhite space\nchars", "This is string with 1234 numbers", "This is string with \0 and ".chr(0)."null chars", //for binary safe "This is string with multiple space char", "Testing invalid \k and \m escape char", "This is to check with \\n and \\t" //to ignore \n and \t results ); // loop through each element of the array for 'str' for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count+1)." --\n"; var_dump( chunk_split( $values[$count], $chunklen, $ending) ); } echo "Done" ?> --EXPECTF-- *** Testing chunk_split() : with different double quoted values for 'str' argument *** -- Iteration 1 -- string(4) "????" -- Iteration 2 -- string(5) " ????" -- Iteration 3 -- string(41) "This ????is si????mple ????strin????g????" -- Iteration 4 -- string(43) "It's ????strin????g wit????h quo????tes????" -- Iteration 5 -- string(59) "This ????conta????ins @???? # $ ????% ^ &???? char????s????" -- Iteration 6 -- string(70) "This ????strin????g con????tains???? whit????e spa????ce ch????ars????" -- Iteration 7 -- string(60) "This ????is st????ring ????with ????1234 ????numbe????rs????" -- Iteration 8 -- string(69) "This ????is st????ring ????with ???? and???? nul????l cha????rs????" -- Iteration 9 -- string(90) "This ????is st????ring ????with ???? mu????ltipl????e ???? ????space???? char????" -- Iteration 10 -- string(69) "Testi????ng in????valid???? \k a????nd \m???? esca????pe ch????ar????" -- Iteration 11 -- string(59) "This ????is to???? chec????k wit????h \n ????and \????t????" Done