$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);
问题是我用双引号得到结果,如何删除双引号
最佳答案
尝试在 php 中修剪
<?php
$name = "Aman";
$str = json_encode($name);
echo trim($str, '"'); // output : Aman
?>
关于php - 删除 echo json_encode() 上的引号;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42509179/