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

mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???

this is the code i got

Hits this week counter
I have a counter on my site that tracks hits, IP's, etc. into a mySQL database. It also includes the

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

removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0m

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those.

asking for direction
I have 2 tables in my data, which are "post" and "event"
I won't make a summa

ALV List display - header width adjust
Hi,

I am using REUSE_ALV_LIST_DISPLAY for my ALV display.The width of the ALV varies for

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

RSS feed - FeedList for WordPress
Hi,

I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of

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