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

PRotect my POST DATA... FROM HTML ATTACKS
I need to like let's say

If a user submit's his Prayer and he put's <meta refresh stuf

Production of mango in processing industry
Hi,

We have one scenario ,company is in process industry,they are manufacturing MANGO pul

Disabling SAP menu
How do I disable SAP menu for all the users and just restrict them to User Menu in SAP ECC 6.0?

Error in SQL Syntax HELP!!!
I have this page:

Code: <?php

session_start();

//connect to server and s

Populate drop down list from table??
Lets say for arguments sake that i have a table which contains the numbers 1 to 10.
How can i get

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou

Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PH

I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to

Unable to display contents in Second Drop Down Box
Hi All,

What I am trying to do is 2 dependent drop down boxes and when user selects su

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