You are here: Re: Having expression migranes « All PHP « IT news, forums, messages
Re: Having expression migranes

Posted by Rik on 05/08/06 11:12

jenngra@gmail.com wrote:
> I need an expression which will only pass/clear currency data, 0.00
> thru 9999999.00. How would that be parsed? Thanks so much!

Regular Expression?
Sure 9999999,99 isn't allowed? Saves some code.

'/(0\.[0-9]{2}|[1-9][0-9]{0,5}\.[0-9]{2}|[1-9][0-9]{6}[0-8]\.[0-9]{2}|999999
9\.00)/'

But why not:
$max = 9999999.00;
$min = 0.00;
$pass = (isfloat($data) && number_format($number, 2, '.', '')==$data &&
$data >= 0 && $data<=9999999);
Makes it a bit more versatile.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация