Home > php教程 > php手册 > body text

php端使用二维数组与iOS进行Json通讯

WBOY
Release: 2016-06-06 19:58:55
Original
1265 people have browsed it

不过这里有一些不足,因为从php中发送的数据,可以看出,还需要在iOS进行进一步处理,才能得到最终文件的路径 找到了php使用二维数组的资料,写了一小段测试例子(真是新手了),等初步完成之后,再回过来修改这一部分: [php] view plaincopyprint? ?php $arr

不过这里有一些不足,因为从php中发送的数据,可以看出,还需要在iOS进行进一步处理,才能得到最终文件的路径


找到了php使用二维数组的资料,写了一小段测试例子(真是新手了),等初步完成之后,再回过来修改这一部分:

[php] view plaincopyprint?

  1. $arr[0]=array(  
  2.             "album_cover" => "img3.test.com/p1030872603.jpg",  
  3.             "album_id" => 49705332,  
  4.             "album_name" => "\U522b\U4eba\U7684\U4e66\U623f",  
  5.             "user_id" => 1233832,  
  6.             "user_name" => "\U72d0\U8760",  
  7.             "user_picurl" => "img3.test.com/icon/u1233832-146.jpg",  
  8.         );  
  9. $arr[1]=array(  
  10.             "album_cover" => "img4.test.com/p1880278549.jpg",  
  11.             "album_id" => 91536010,  
  12.             "album_name" => "\U65e7\U5ba4\U65b0\U5c45[\U5317\U4eac50\U5e73\U7c73\U5c0f\U5bb6]",  
  13.             "user_id" => pei830,  
  14.             "user_name" => PEI,  
  15.             "user_picurl" => "img3.test.com/icon/ul2341445-326.jpg",  
  16.         );  
  17. $arr[2]=array(  
  18.             "album_cover" => "img5.test.com/p1880278549.jpg",  
  19.             "album_id" => 91536010,  
  20.             "album_name" => "\U65e7\U5ba4\U65b0\U5c45[\U5317\U4eac50\U5e73\U7c73\U5c0f\U5bb6]",  
  21.             "user_id" => pei830,  
  22.             "user_name" => PEI,  
  23.             "user_picurl" => "img3.douban.com/icon/ul2341445-326.jpg",  
  24.         );  
  25. $result = json_encode($arr);  
  26. print_r($result);  
  27. ?>  


效果是这样的:

php端使用二维数组与iOS进行Json通讯



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!