Re: preg_match array question
| From: | David Grant | Date: | Fri, 30 May 2003 16:59:58 +0000 |
| Subject: | Re: preg_match array question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149578@lists.php.net to get a copy of this message | ||
Daniel J. Rychlik wrote:
Hey,
Im trying to use preg_match to validate numbers in multiple fields. I can check one field but Im having trouble checking multiple fields.
preg_match ( '(foo)' , $_POST["num1"] ); <- That works fine. but I need to check multiple fields.
I thought I would build an array with the POST data like this...
$num = array ($_POST["num1"],
($_POST["num2"]); There are more than that...
and then use preg_match ('(foo)', $num) ; $num should point to my array, but that doesnt work. I get a warning message.. and it doesnt check the first num1 in the array.
Im certain that Its my code, and I wanted to get some input on what Im doing wrong.
-Dan
A quick search turned this up:
http://www.php.net/manual/en/function.preg-grep.php
--
David Grant
Web Developer
david.grant@wiredmedia.co.uk
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************