What is the use for replacing space for space?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

What is the use for replacing space for space?

Post by RobertGonzalez »

Is this piece of code that replaces a space for a space really doing anything other than slowing down the app?

Code: Select all

$search = str_replace(" ", " ", urldecode($search));
This just seems unusually silly to me.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

replacing space for space.. useless.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I thought so. Man, I cannot believe what some developers do sometimes. That is utterly frustrating. Thanks for the confirmation.
Post Reply