peterworth
March 2nd, 2005, 06:02 AM
well i find it challenging anyway. is the following difficult to do:
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 th end...
i just want to use 1 or 2 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 th end...
i just want to use 1 or 2 preg_replace calls in PHP to do this.
thanks for any help.