...

View Full Version : replace space with  



abcdefGARY
05-22-2008, 07:49 AM
Hi, all.

Just a quick question: is there a PHP function that allows me to replace a blank space with  ?

For example...


This is an example sentence with blank spaces between words.

into this:


This is an example sentence with blank spaces between words.

Thanks!

abduraooft
05-22-2008, 08:08 AM
$str="This is an example sentence with blank spaces between words.";
echo str_replace(' ',' ',$str);

syosoft
05-22-2008, 09:50 AM
I realize you didnt ask about this, but it seems like you're trying to stop a line from breaking. If this is the case... you might want to use


<style>
.nowrap {
white-space: nowrap;
}
</style>
<p class="nowrap">This is an example sentence with blank spaces between words.</p>


Thanks abduraooft :)

abduraooft
05-22-2008, 10:10 AM
<style>
.nowrap {
white: nowrap;
}
</style>
white-space ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum