本文整理汇总了PHP中Json::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Json::run方法的具体用法?PHP Json::run怎么用?PHP Json::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Json
的用法示例。
在下文中一共展示了Json::run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
include "../header.php";
include "../Json.php";
?>
<?php
// ======================
// 请求结果数据
// ======================
$res = array("obj" => array("list" => array(array("id" => 1, "cover" => "img/activity.jpg", "theme" => "源深体育中心周日常规活动", "area" => "上海市浦东源深体育馆", "time" => "每周日上午10点-12点", "joinersLimit" => 25, "joinersCurrent" => 12, "intro" => "为交友为羽毛球的交流,也为歇息的周末"), array("id" => 2, "cover" => "img/activity.jpg", "theme" => "天山羽毛球群周六活动", "area" => "上海市仙霞路古北路上海外经贸大学", "time" => "每周六上午10点-12点", "joinersLimit" => 18, "joinersCurrent" => 10, "intro" => "土豪群,进群前需要审核审核审核"), array("id" => 3, "cover" => "img/activity.jpg", "theme" => "虹桥航华中学周日羽毛球活动", "area" => "上海市闵行区航华中学", "time" => "每周日下午6点-8点", "joinersLimit" => 30, "joinersCurrent" => 20, "intro" => "群里面都是高手哦"), array("id" => 4, "cover" => "img/activity.jpg", "theme" => "复旦中学羽毛球活动", "area" => "上海市徐汇区复旦中学", "time" => "每周六上午10点-12点", "joinersLimit" => 15, "joinersCurrent" => 10, "intro" => "交大人的群"), array("id" => 5, "cover" => "img/activity.jpg", "theme" => "动一动羽毛球馆活动", "area" => "上海市浦东动一动羽毛球馆", "time" => "每周六上午10点-12点", "joinersLimit" => 25, "joinersCurrent" => 10, "intro" => "也是高手也是高手"))));
// ======================
// 请求结果状态
// ======================
$success = 1;
$status = array("success" => $success);
$errmsg = array("msg" => "报错了");
$outArr = $success == 1 ? array_merge($status, $res) : array_merge($status, $errmsg);
echo Json::run($outArr);