Well,   isn't exacly ASCII value for a space, but it makes NoBreakingSPace 🙂 and it should display like you wanted...

$message = str_replace(chr(0), " ", $message);

Hope it helps, Arni

    I am a idiot. I have those in there they just displayed as spaces since this message board is viewed as html. Duh! The problem isnt a single space thats covered. It is consecutive multiple spaces. The piece of code you gave i am already using but it isnt working i need an alternate method.

      the code isnt replacing the chr(0) with the nbsp at all otherwise yes it would work

        Why not just:
        $message = str_replace(" ", " ", $message); ?

          Try
          $string = ereg_replace( '[[:space:]]+', '\ ', $string );

          Something like that should work

            you mentioned nbsp in a post? I presume you mean  , otherwise it won't work, it the above gives a space...

            & n b s p ; without the spaces :-)

              The ascii value for space is 32 (decimal) or 20 (hex)

                Thanks gentleman i have it working now i used the code i had and changed the ascii value to 32 at Ken's suggestion. I also like the ereg replace function but i dont feel comfortable with it. I just need to learn how to make it work.

                Thanks Again everyone

                  ASCII equivalent is 0x20 (hex) or 32 decimal.

                  ArniHr wrote:

                  Well,   isn't exacly ASCII value for a space, but it makes NoBreakingSPace 🙂 and it should display like you wanted...

                  $message = str_replace(chr(0), " ", $message);

                  Hope it helps, Arni

                    Write a Reply...