Re: simple ereg question

From: Date: Sun, 23 Feb 2003 23:52:32 +0000
Subject: Re: simple ereg question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-136787@lists.php.net to get a copy of this message
At 01:01 24.02.2003, Robert E. Harvey, M.D. said: --------------------[snip]-------------------- > if (is_numeric($_POST["gamt_$i"]) or empty($_POST"gamt_$i")) > >or this: > > if (is_numeric($_POST["gamt_$i"]) || empty($_POST"gamt_$i")) > >I get this error message (my if statement is on line 5): > >*Parse error*: parse error, unexpected '\"', expecting ')' in >*/var/www/html/calc/pad_test.php* on line *5 >* >Now, where did that come from? --------------------[snip]-------------------- try to always use square brackets when accessing an array element, like if (is_numeric($_POST["gamt_$i"]) or empty($_POST["gamt_$i"])) or this: if (is_numeric($_POST["gamt_$i"]) || empty($_POST["gamt_$i"])) -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#136787) next »