[PHP-DEV] PHP 4.0 Bug #9120 Updated: unexpected behavior of chop(), ltrim(), rtrim(), and trim() From: stas <email protected>
Date: 03/20/01

ID: 9120
Updated by: stas
Reported By: artymiak <email protected>
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 <email protected>
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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>