PHP Delete Spaces

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
Hi i want to delete blank space in login and password when people put it. How i can do it.
Question by:umaxim
  • 3
LVL 111

Expert Comment

by:Ray Paseur
ID: 35724329
Use something like str_replace(' ', NULL, $str);
LVL 111

Accepted Solution

Ray Paseur earned 2000 total points
ID: 35724330
Use something like str_replace(' ', NULL, $str);
LVL 10

Expert Comment

by:Tyler Laczko
ID: 35724377
$s = str_replace(' ', '', $s);

Author Closing Comment

ID: 35724397
thank you
LVL 111

Expert Comment

by:Ray Paseur
ID: 35724968
Thanks for the points.  Sorry for the double posting - I must have fat-fingered the submit button!

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question