note 78907 deleted from function.chop by felipe
| From: | felipe@php.net | Date: | Sun, 16 Dec 2007 11:08:50 +0000 |
| Subject: | note 78907 deleted from function.chop by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133644@lists.php.net to get a copy of this message | ||
Note Submitter: sam at pageindigo dot com
----
I don't know Perl so I am not sure how close/far this is from its chop() behavior but if you
just want to remove line endings from a string you can do...
<?php
rtrim($string,"\n\r");
?>
All of PHP's trim function accept an optional character mask.