简体   繁体   中英

send array from php to android

Hi i have a DirectoryIterator that is used to store the filepath to all the files in a certain directory in the server .

The php code follows:

$iterator = new RecursiveIteratorIterator(
 new RecursiveDirectoryIterator($path),
 RecursiveIteratorIterator::LEAVES_ONLY
);

foreach ($iterator as $fileObject) {
  $files[] = $fileObject;
}

I know that to print the array i would have to use print(json_encode($files[])

But how to decode it on the android side

You don't need to decode this file. You will be response from server in a JSON or XML format. and parse the json from server response. it will get datatype like string or int.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM