Home > Article > Backend Development > PHP rtrim function bug_PHP tutorial
Test code:
<?<span php </span><span $str</span> = <span rtrim</span>('article_list.html', '.html'<span ); </span><span echo</span> <span $str</span><span ; </span><span echo</span> '<br />'<span ; </span><span $str</span> = <span rtrim</span>('article_index.html', '.html'<span ); </span><span echo</span> <span $str</span><span ; </span><span echo</span> '<br />'<span ; </span><span $str</span> = <span rtrim</span>('articleABCT.html', '.html'<span ); </span><span echo</span> <span $str</span><span ; </span><span echo</span> '<br />'<span ; </span>?>
Display results:
article_index
articleABCT
WINNT Apache/2.2.16 (Win32) PHP/5.2.14 (local PHPnow 1.5.6-1)
Linux Apache 2.0 PHP/5.2.17p1 (wdcp_v2.5.7)
Linux LiteSpeed PHP/5.2 .17 (Sleepwalk Host)
Linux Apache 2.0 PHP/5.2.17 (Worry-Free Host)
PHP rtrim function bug