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

Echo multiple lines of html code
Hi guys,

I would like to know if there is a way to echo multiple lines of html codes.

Firewall / visited websites logger
Hi. I have a firewall implementation and I want to log all the websites visited on the machine. S

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

pspell
using pspell, is it possible to get words that would be best in the current phrase?

For examp

timed header image rotation
I have a joomla site and I was trying to setup a rotating image based on timing NOT just refreshing

Multiple arrays inside data
Hi,

Simple question. I have a column called "array" in my database, and inserted in

Upload, SSL and more php help
I recently just installed a ssl cert and do i use https for the whole site or just for the checkout.

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

date function help
i need help with date function

Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H

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