ereg_replace help wanted
| From: | George Pitcher | Date: | Wed, 29 Sep 2004 13:46:00 +0000 |
| Subject: | ereg_replace help wanted | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-24663@lists.php.net to get a copy of this message | ||
Hi,
I don't want to spend a lot of time leaning how to use this function but I
have a problem that I think it can solve.
I have a web form that allows the user to (amongst other things) submit a
pagerange to my database. Using '-' and ',' as separators, I am able to
calculate the number of pages being submitted.
I can handle roman or arabic numerals and a typical range might look like:
'ix-xxvii,21-30,64' and that would usually give me a page count of 30.
The problem is that I think that some of my users are pasting the range in,
rather than re-typing (I don't really want to stop them from pasting) and I
am sure that sometimes the '-' is coming over as something other than a
conventional hyphen.
Can anyone suggest a filter that will handle my hyphens correctly,
regardless of what type of hyphen the user is entering?
MTIA
George in Oxford