Function str_replace

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjava
    New Member
    • Sep 2009
    • 132

    Function str_replace

    Hi,

    I have issue with this script :

    chr(13) and chr(10).chr(9): there code ASCII for that CR LF ------->

    Code:
    str_replace(chr(13).chr(10).chr(9),"",$object);
    it's not replace this by NULL
    how can i do that please

    Thanks in advance
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you’re looking for the exact match of CR LF TAB. that is, a single CR or CR LF does not match and thus is not replaced. if you want to replace each of the three characters, use an array.

    Code:
    echo str_replace([chr(13), chr(10), chr(9)], '', $string);

    Comment

    Working...