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

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

Pspell with my own dictionary
Hello!
I've tested two cases using pspell functions.
1)
Code: $dictionary_link = pspell_new

Is this Safe or Unsafe?
Hi i made a few pages with lots of peoples help now i just want to know if they are safe or not can

php forms and database navigatio
Hello,
I'm new to php and i'd like to post the following.
I have written code to get records f

UL and LI Add Form
The idea I want here is when the user click on a character name from the drop down select bar at the

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

browse folder only
hi,
is there a way i can browse or get the directory or folder only and not the file?
i just w

list files from folder, only one for each date
I have many files in a folder and wish to only list one of each date

these are the file names

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