PDA

View Full Version :  /space replacement



magicyte
10-20-2008, 01:42 AM
Is there any possible way to replace a space with   in any string w/ JavaScript or PHP? It be best if you give me an example in JavaScript.

-magicyte

zaphod42
10-20-2008, 02:30 AM
var myString='this is my string'
myString.replace(/ /g,'&nbsp')

or


myString.replace(/(&nbsp)/g,' ')

magicyte
10-20-2008, 11:12 PM
Thanks.

-magicyte