????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.19.28.64 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 nl2br() function : usage variations - heredoc strings for 'str' argument --FILE-- <?php /* Prototype : string nl2br(string $str); * Description: Inserts HTML line breaks before all newlines in a string. * Source code: ext/standard/string.c */ /* Test nl2br() function by passing heredoc strings containing various * combinations of new line chars to 'str' argument */ echo "*** Testing nl2br() : usage variations ***\n"; //heredoc string containing new line chars(\n, \r and combinations of \r & \n) and new lines $heredoc_str1 = <<<EOD \n \r \r\n \nnn\n\n\nn \rrr\r\r\rr \n\r\n\r\r\n\nr\rn EOD; //heredoc string containing embedded 'new line chars'/'new lines' in the string $heredoc_str2 = <<<EOD Hello\nWorld\r This is \tes\t for \n \new lines like \n \r\n \r \n\r and etc EOD; var_dump(nl2br($heredoc_str1) ); var_dump(nl2br($heredoc_str2) ); echo "Done"; ?> --EXPECTF-- *** Testing nl2br() : usage variations *** string(147) "<br /> <br /> <br /> <br /> <br /> <br /> nn<br /> <br /> <br /> n<br /> rr<br /> <br /> <br /> r<br /> <br /> <br /> <br /> <br /> r<br /> n" string(118) "Hello<br /> World<br /> This is es for <br /> <br /> ew lines<br /> like <br /> <br /> <br /> <br /> and etc" Done