我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

将PHP数组转换为Json字符串[重复]

This question already has an answer here:

  • PHP/jQuery - How To Convert A Multidimensional PHP Array To JSON String? 2 answers

Just wondering if it is possible to convert a PHP array to JSON string Heres the following PHP array:

array ( 
     'players' => array ( 
          '123' => '345'
          '567' => '789'
      ), 
     'non_players' => array ( 
          0 => '71558060', 
          1 => '14451395', 
          2 => '16428783', 
          3 => '12070702', 
          4 => '16872249', 
          5 => '10081837', 
          6 => '10000363', 
          7 => '10084478', 
     ), 
)

Is it possible to convert to JSON string?

</div>

You could just use json_encode(), from the PHP manual: http://www.php.net/manual/en/function.json-encode.php

近期文章

  • 选中下拉框中的值时,启用文本框[关闭]
  • 使用get请求从数据库中删除行是否安全? [重复]
  • 困惑为什么我的PHP包含不起作用[关闭]
  • 重定向问题而不是正确的细节
  • 如果查询为空,mysqli_query会返回什么
  • 目的是!$和差异b / w isset和空? [重复]
  • 如何从PHP中的多维数组中删除重复值[重复]
  • 什么是mysql_fetch_array()期望参数1是资源? [重复]
  • 如何显示值类似的所有数组键?
  • PHP“IF条件”[关闭]
  • PHP表单到数组[关闭]
  • 所有阵列的可能性
  • PHP代码不起作用[关闭]
  • 如何在PHP中写一个干净的网址? [重复]
  • 一些代码添加到我的php文件中
  • 从JSON密钥中删除引号
  • 从数组中获取元素[关闭]
  • 请帮我解决PHP代码[关闭]
  • 提交返回空白页面
  • jQuery验证功能不起作用[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华