Home > Backend Development > PHP Tutorial > PHP写的server端,怎么接收手机客户端传来的json数据

PHP写的server端,怎么接收手机客户端传来的json数据

WBOY
Release: 2016-06-13 13:40:13
Original
858 people have browsed it

PHP写的server端,如何接收手机客户端传来的json数据
PHP写的server端,如何接收手机客户端传来的json数据?


------解决方案--------------------
$link = fopen("php://input", 'r');
打开php的输入流,所有提交到该文件的数据都可用用此获取
$json = fread($link, 10000);
读取刚才打开的输入流,最多读取10000字节
官方手册上是英文的,找了篇中文的解释 http://www.perfgeeks.com/?p=150

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template