Edit report at https://bugs.php.net/bug.php?id=60589&edit=1

 ID:                 60589
 Comment by:         anon at anon dot anon
 Reported by:        pehohlva at gmail dot com
 Summary:            str_replace error
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   lenny debian
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

str_replace works fine. You're just not using its result. str_replace returns 
the altered string; it doesn't change the original. Do:
$item = str_replace(" ", "", $item);


Previous Comments:
------------------------------------------------------------------------
[2011-12-21 21:07:49] pehohlva at gmail dot com

meant is: str_replace() doesnt recognise ascii 32 as whitespace / space.

------------------------------------------------------------------------
[2011-12-21 21:02:49] pehohlva at gmail dot com

Description:
------------
str_replace() error:

following construct delivers true on using phpexcelreader on ms excelfile  as 
$item if $item = ord($item)=32

that means, not all whitespaces where found with str_replaces()




Test script:
---------------
foreach($user as $key=>$item)
            {
              if(trim(str_replace(" ","",$item)) == "")
              {
                 
                  echo"<br>items:".ord($item);
              }
          }


output will be displayed with ascii 32 (space). Should be not possible.

Expected result:
----------------
dump->NULL

Actual result:
--------------
" " (space ascii 32


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



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

Reply via email to