iterating through an array and escape each value independently.


Posted on 16th Feb 2014 07:03 pm by admin

I have a set up where the variable being escaped is an array and it needs to be iterated and escaped by separate. I need some help.

Code: <?php

Did you know?Explore Trending and Topic pages for more stories like this.
$arrFoodTypes = isset($_REQUEST['frmSearch']['food_types'])?mysql_real_escape_string($_REQUEST['frmSearch']['food_types']):array();
?>
How can I fit that if else statment inside the below foreach loop. the indexes has been a difficult to place them

Code: <?php
foreach($_REQUEST as ['frmSearch]=>'['food_types'])
{$data['frmSearch']=mysql_real_escape_string(['food_types]);}
?>

Is this correctly syntaxed it? if any syntax error or mistake please correct me. Is iteration possible with the above set up at the foreach loop?
No comments posted yet

Your Answer:

Login to answer
104 Like 40 Dislike
Previous forums Next forums
Other forums

SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

MySQL-PHP Query Results Help
Hello all. I'm hoping to be able to get some help in solving a problem with query/rowcount output. I

am I using this for loop correctly
Dear buddies!

Right now I am generating a report with some details for all the dealers.

NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder '

(sub)screen resize modification doesn't work after ECC 6 EhP 4 installation
Hello,

We have previously extended the size of the custom data tab on PO transaction ME23

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

mysql select with $_get ?
Hi, i have this code:
Code: // If char id is 0 and character dont exist do:
if ($_GET["id

Wrong Info sent Using $get in form
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash