Syntax to process array from a POST, android?

74 Views Asked by At

I am passing an array to http post from my android app to php server as follows:

params.add(new BasicNameValuePair("image[]", encodedImage));

Now I want all the values on image array, in my php code. How to achieve that?

How to write code for this?- I wanted to loop over this array and insert each image from image[] in php.

when I am trying to do

if(isset( $_POST['image'] )){
$images = array($_POST['image']);
  while($row = $images){
  //insert into table
  }
}

But this is not helping

This if condition for isset is failing.

1

There are 1 best solutions below

3
aldrin27 On

Try this: if this works

if(isset($_POST['images'])){
  $images[] = $_POST['images'];

while($row = $images){
  //your query here
}