如何在php中打印数组值? [英] How to print the array values in php?

查看:302
本文介绍了如何在php中打印数组值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何替换php中的数组

How i can replace the array values in php

 Array ([0] => Array ([ss] => k))

 array("0" => array ("ss" => "k"));


推荐答案

您必须编写自己的函数以输出格式

You have to write you own function to output the format you like.

具有内置功能的最近解决方案是 var_export

While the nearest solution with build-in function is var_export.

$array = array(array('ss' => 'k'));
var_export($array);

输出:

array (
  0 =>
  array (
    'ss' => 'k',
  ),
)

这篇关于如何在php中打印数组值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆