Amending variables in a $_POST array - sense check needed
Posted: Wed Dec 10, 2008 7:45 am
Hi all
I want to convert variables in a $_POST array into money format before I process them. I'm not entirely confident about accessing arrays in this way. I know the following loop hangs. Can someone tell me where I'm going wrong please?
Any help is very much appreciated.
Thanks, Steve
I want to convert variables in a $_POST array into money format before I process them. I'm not entirely confident about accessing arrays in this way. I know the following loop hangs. Can someone tell me where I'm going wrong please?
Any help is very much appreciated.
Thanks, Steve
Code: Select all
for ($x=0; count($_POST['price']); $x++)
{
if ($_POST['price'][$x] != '')
{
$_POST['price'][$x] = money_format('%i', $_POST['price'][$x]);
}
}