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

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

CURL question
i am wondering if it's possible to use multi curl with login something like

login once to web

foreach loop, assistance request
I would like some guidance on the usage of foreach as I try to parse through a large database and wh

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

Echoing If Function?
A script I am using has If statements in the comments form to basically tell the form what to do. Cu

What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

Array help
Hello i got this code to fetch data from database but it is not working it displays
7
Array

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

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