3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text1="w3resource.com "; $text2="w3resource.com\t\t"; $text3="\t\tw3resource.com\x0A"; $text4="Good Morning"; $trimmed_text=rtrim($text1); var_dump($trimmed_text); echo '<br>'; $trimmed_text=rtrim($text2); var_dump($trimmed_text); echo '<br>'; $trimmed_text=rtrim($text3); var_dump($trimmed_text); echo '<br>'; $trimmed_text=rtrim($text1,'w3'); var_dump($trimmed_text); echo '<br>'; $trimmed_text=rtrim($text4,"ng"); var_dump($trimmed_text); ?>
Output for 4.3.0 - 7.1.0
string(14) "w3resource.com" <br>string(14) "w3resource.com" <br>string(16) " w3resource.com" <br>string(16) "w3resource.com " <br>string(10) "Good Morni"