|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Replacing punctuation in a string
i want to change a string to contain only alphanumeric characters and spaces, by stripping out everything else and replacing them with a space.
i think it would probably use preg_replace() but i'm having trouble writing the regex that will correctly do this. |
|
#2
|
||||
|
||||
|
PHP Code:
^ = NOT the following 0-9 = numerals zero to nine a-z = letters a to z \s = whitespace i = insensitive to case ![]()
__________________
* But to teach us, that for the similitude of the thoughts, and Passions of one man, to the thoughts, and Passions of another, whosoever looketh into himself, and considereth what he doth, when he does think, opine, reason, hope, feare, &c, and upon what grounds; he shall thereby read and know, what are the thoughts, and Passions of all other men, upon like occasions.
|
|
#3
|
|||
|
|||
|
oooh, the ^ helps so much. thank you!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Replacing punctuation in a string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|