By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Delete spaces from variabele

P: n/a
Hello,

How can you delete spaces within a variabele (php4)?

$var = "This is an example variabele."

To :

$var = "Thisisanexamplevariabele."

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
InSeCo wrote:
Hello,

How can you delete spaces within a variabele (php4)?

$var = "This is an example variabele."

To :

$var = "Thisisanexamplevariabele."


Simple.

$var = str_replace(" ", "", $var);

--
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/
Jul 17 '05 #2

P: n/a
In article <11*************@corp.supernews.com>, Scriptdude wrote:
InSeCo wrote:
Hello,

How can you delete spaces within a variabele (php4)?

$var = "This is an example variabele."

To :

$var = "Thisisanexamplevariabele."


Simple.

$var = str_replace(" ", "", $var);


It's a bit better if $var = str_replace(' ', '', $var) since
double quotes will result in an unnecessary parsing. Right?
Jul 17 '05 #3

P: n/a
Daniel C. Bastos wrote:
It's a bit better if $var = str_replace(' ', '', $var) since
double quotes will result in an unnecessary parsing. Right?


True.

--
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.