$result = mysql_query("SELECT * FROM $tableName WHERE id=1");
$array = mysql_fetch_array($result);
$help_name = $array['name'];
$req = $array['req'];
//fetch result
echo json_encode($help_name);问题是我得到了带有双引号的结果,如何删除双引号
发布于 2017-02-28 21:03:31
尝试在php中修剪
<?php
$name = "Aman";
$str = json_encode($name);
echo trim($str, '"'); // output : Aman
?>发布于 2017-02-28 20:52:52
$help_name = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', $help_name);https://stackoverflow.com/questions/42509179
复制相似问题