在我的PHP代码中
$sql = "SELECT a.SEQ, a.DPCODE, a.SUBJECT, CONCAT_WS('~',a.SDATE, a.EDATE) AS SDATE, b.content, concat(replace(c.filepath,'E:/WWW','http://myhome.com/'),c.filelocalnm) as filename";
$sql .= " FROM PJ_EXHIBIT a LEFT JOIN collection.exhibit b ON a.SEQ=b.seqno LEFT JOIN sy_file c ON a.attach_file = c.SEQ";
使用json_encode
,它会返回:
我想删除' \'。
答案 0 :(得分:0)
您可以使用str_replace
<?php
$variable = 'http:\/\/comin.com:8990\/\/upload\/pj\/PJ_EXHIBIT\/1480308974751289.jpg';
$new = str_replace('\\', '', $variable);
echo $new;
?>
或者您可以使用preg_replace
<?php
$variable = 'http:\/\/comin.com:8990\/\/upload\/pj\/PJ_EXHIBIT\/1480308974751289.jpg';
$new = preg_replace("/\\\/", '', $variable);
echo $new;
?>
<强>手册强>
更多信息可以在下面找到: