PHP 4.0 Bug #9120 Updated: unexpected behavior of chop(), ltrim(), rtrim(), and trim()
| From: | stas@php.net | Date: | Tue, 20 Mar 2001 10:54:50 +0000 |
| Subject: | PHP 4.0 Bug #9120 Updated: unexpected behavior of chop(), ltrim(), rtrim(), and trim() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49475@lists.php.net to get a copy of this message | ||
ID: 9120
Updated by: stas
Reported By: artymiak@safenet.pl
Old-Status: Open
Status: Closed
Bug Type: Strings related
Assigned To:
Comments:
Works for me perfectly - except that \v is not recognized by
PHP. Who needs it anyway?.
Previous Comments:
---------------------------------------------------------------------------
[2001-02-05 16:51:27] artymiak@safenet.pl
chop(), trim(), ltrim(), and rtrim() do not remove v, r, or n.
# chop();
echo "<p><pre> chop()";
echo "<br> ------------------<br>";
$x = " ab cd ef vrn" ;
echo strlen($x) . " characters: |" . $x . "|<br>";
$y = chop($x);
echo strlen($y) . " characters: |" . $y . "|</pre></p>";
# ltrim();
echo "<p><pre> ltrim()";
echo "<br> ------------------<br>";
$x = "vrn ab cd ef " ;
echo strlen($x) . " characters: |" . $x . "|<br>";
$y = ltrim($x);
echo strlen($y) . " characters: |" . $y . "|</pre></p>";
# rtrim();
echo "<p><pre> rtrim()";
echo "<br> ------------------<br>";
$x = " ab cd ef vrn" ;
echo strlen($x) . " characters: |" . $x . "|<br>";
$y = rtrim($x);
echo strlen($y) . " characters: |" . $y . "|</pre></p>";
#
# trim();
echo "<p><pre> trim()";
echo "<br> ------------------<br>";
$x = " vrn ab cd ef vrn " ;
echo strlen($x) . " characters: |" . $x . "|<br>";
$y = trim($x);
echo " " . strlen($y) . " characters: |" . $y .
"|</pre></p>";
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9120&edit=2