Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何替换arrayphp中的值
array
Array ([0] => Array ([ss] => k))
进入
array("0" => array ("ss" => "k"));
您必须编写自己的函数来输出您喜欢的格式。
而具有内置功能的最接近的解决方案是var_export.
var_export
$array = array(array('ss' => 'k')); var_export($array);
输出:
array ( 0 => array ( 'ss' => 'k', ), )