We help IT Professionals succeed at work.
Get Started

PHP foreach loop on $_Request

Last Modified: 2013-05-23

Ok, say you send this to a php page test.php


They get cleaned:
foreach (array_keys($_REQUEST) as $key) {
 $$key = $mysqli->real_escape_string(($_REQUEST[$key]));

Now I have these:


Forget about the $p & the $w.

I want to now loop through only the $vx (where x is the number)

foreach(of-the-ones-the-start-with-a-v) {


      $arr=explode(',', $v);

And now I do something with the $first,$second,$third


What needs to go here:
And here:

Thank you for viewing my question, any help appreciated.
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE