#20283 [Bgs]: Trim function doesn't work at all

From: Date: Thu, 07 Nov 2002 08:36:18 +0000
Subject: #20283 [Bgs]: Trim function doesn't work at all
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-24262@lists.php.net to get a copy of this message
 ID:               20283
 User updated by:  glanzafilippi@molinette.piemonte.it
 Reported By:      glanzafilippi@molinette.piemonte.it
 Status:           Bogus
 Bug Type:         Strings related
 Operating System: Linux RedHat 7.3
 PHP Version:      4.2.3
 New Comment:

Thanks for your answer, but my question remain. I know that trim
function only 'trim' spaces, but in my case trim doesn't trim anything.
No spaces and no other charlist. 

From the online manual:
>Without the second parameter, trim() will strip these >characters:  
>" " (ASCII 32 (0x20)), an ordinary space.

Probably i'm explaining the problem in a wrong way. Please tell me
where i'm wrong.

Thanks.


Previous Comments:
------------------------------------------------------------------------

[2002-11-06 10:04:58] iliaa@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

Trim function will only trim 'space' characters, unless you specify a
list of characters you want to trim via the 2nd, optional parameter.

------------------------------------------------------------------------

[2002-11-06 10:00:24] glanzafilippi@molinette.piemonte.it

My Os is Linux Red Hat 7.3. Web Server is Zeus 4.1r3.
I compiled php with fastcgi.

i tried in several way but i noticed that in every case trim function
doesn't work at all.

This is a little piece of code:
<?php
// $user_data['unitHospital'] == "Osp. San Giovanni"
$fileNameCleaned = trim($user_data['unitHospital']);
print($fileNameCleaned); 
?>

Result
Osp. San Giovanni

OR directly

<?php
$tmp = trim("dd ff  hhkkk");
print($tmp);
?>

Result:
dd ff  hhkkk

The same result with 'rtrim' -- 'ltrim' and with a direct specification
of charlist.

Thanks



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20283&edit=1



Thread (5 messages)

« previous php.bugs (#24262) next »