I'm attempting a bit of php and wondered if someone could point me in the right direction.
This transforms to lowercase, removes punctuation with the exception of '.' and removes multiple/leading/ending spaces.
I was wondering if it is possible to leave '-' IF it is in a number e.g. 1800-2?
Any help greatfully received.
Code:
$return = trim(ereg_replace(' +',' ',preg_replace('/[^a-zA-Z0-9.\s]/','',strtolower($input))));
This transforms to lowercase, removes punctuation with the exception of '.' and removes multiple/leading/ending spaces.
I was wondering if it is possible to leave '-' IF it is in a number e.g. 1800-2?
Any help greatfully received.
Comment