I am trying to take a string and firstly:
Spit it back out with no characters other than letters and numbers, and with the first letter of every word capitalized.
Secondly:
Do the same thing as above, but remove all spaces from the string.
I've been advised to use the following functions:
strlen() (Accompanied by a for loop to go through every character)
strpos()
substr()
I am unsure how to set this up. Can anyone help?
Manipulating a string??
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
maybe a regex is the way to go? but they can be somewhat tricky.
http://ca3.php.net/manual/en/function.preg-replace.php
http://ca3.php.net/manual/en/function.preg-replace.php