菜鸟求教,如何返回JSONObject给客户端
Jun 23, 2016 pm 02:26 PM 本人在要实现android客户端登陆,然后服务端返回一个JSONObject给客户端的java程序,求教 如何返回JSONObject
比如sn=>123,fn=>234
回复讨论(解决方案)
json_encode
$rt_info = array("rand"=>$rd,"sessionId"=>session_id());
echo json_encode($rt_info);
这样写可以么,为什么客户端程序调试log显示会把整个PHP文字内容都作为返回值打印出来了,应该怎么返回

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon

Announcement of 2025 PHP Situation Survey
