Re: One more data formatting question [SOLVED]

From: Date: Thu, 29 Nov 2007 15:32:29 +0000
Subject: Re: One more data formatting question [SOLVED]
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-265236@lists.php.net to get a copy of this message
Hi: Thanks for the answer! That worked exactly as I needed it to work! Jon ----- Original Message ----- From: "T.Lensselink" <dev@lenss.nl> To: "Jon Westcot" <jon@westcot.net> Cc: "PHP General" <php-general@lists.php.net> Sent: Thursday, November 29, 2007 8:17 AM Subject: Re: [PHP] One more data formatting question On Thu, 29 Nov 2007 07:53:56 -0700, "Jon Westcot" <jon@westcot.net> wrote: > Hi all: > > I'm trying to parse out some HTML code back into "regular" string > values and I keep getting tripped up by the non-breaking space value > ( ). I see that html_decode_entities() can be used to convert this > back to a viewable space, but the documentation tells me that the space > value it uses is not the same as a TRIMable space (i.e., ASCII 32). > > Is there a quick, fast, and easily implemented way to convert any > non-breaking space found in a string back to the ASCII 32 space value? I > suspect that one of those amazing POSIX expressions could do it, but I'm > having trouble wrapping my head around them at this early hour. > > Any help you all can provide will be extremely appreciated! > > Thanks, > > Jon str_replace should do the trick. str_replace('&nbsp;', chr(32), $string); or str_replace('&nbsp;', ' ', $string);

« previous php.general (#265236) next »