peterworth
Programmer
i'm trying to do the following and have got a bit confused:
replace a string so that only alpha-numeric characters remain, deleting spaces and all EXCEPT if there is a space in the middle of the string - then keep it. if there are spaces at the end or beginning of the string (before or after all alpha-numeric characters) delete them, and if there is more than one space in the middle of the string then only keep the one nearest the end...
i just want to use a few preg_replace calls in PHP to do this.
thanks for any help.
replace a string so that only alpha-numeric characters remain, deleting spaces and all EXCEPT if there is a space in the middle of the string - then keep it. if there are spaces at the end or beginning of the string (before or after all alpha-numeric characters) delete them, and if there is more than one space in the middle of the string then only keep the one nearest the end...
i just want to use a few preg_replace calls in PHP to do this.
thanks for any help.