note 32755 modified in function.rtrim by danbrown
| From: | danbrown@php.net | Date: | Sun, 14 Dec 2008 17:22:36 +0000 |
| Subject: | note 32755 modified in function.rtrim by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148153@lists.php.net to get a copy of this message | ||
<?php
$text = "This string contains some unwanted characters on the end.";
$text1 = rtrim($text, 'a..z');
$text1 = rtrim($text1, '.');
echo $text1; // only the '.' is trimmed.
$text2 = rtrim($text, 'a..z.');
echo $text2; // The whole last word is trimmed.
?>
--was--
$text = "This string contains some unwanted characters on the end.";
$text1 = rtrim($text, 'a..z');
$text1 = rtrim($text1, '.');
echo $text1; // only the '.' is trimmed.
$text2 = rtrim($text, 'a..z.');
echo $text2; // The whole last word is trimmed.
http://php.net/manual/en/function.rtrim.php