I cannot figure out regular expressions. Examples would help.
How would I make it check if $variable is in “1.23” “12.3” or “12” format. Also how would you check if $variable is “filename.gif|png|bmp|jpg or directory/filename.gif|png|bmp|jpg.
@jasonahouleDec 03.2007 — #There are lots of different was to do it. You don't have to use regular expressions if you don't want to. The first example you could use strpos() to find the location of the decimal. The second one you could use explode() to get the extension and then a switch statement to test for a value.
Anyway, my point is regex is not your only option.
@Pixel-ArtistauthorDec 03.2007 — #There are lots of different was to do it. You don't have to use regular expressions if you don't want to. The first example you could use strpos() to find the location of the decimal. The second one you could use explode() to get the extension and then a switch statement to test for a value.
Anyway, my point is regex is not your only option.[/QUOTE]
Well I really don't care where the decimal point or even if it does have a decimal point just want to to be numbers with or without a decimal point.