我的脚本正在生成一个类似于:
的JSON文件[{"activeSheetIndex":0,"sheetCount":1,"tabStripRatio":0.5,"tabStripVisible":true,"tabEditable":true,"newTabVisible":true,"referenceStyle":0,
但是就像:
{\"activeSheetIndex\":0,\"sheetCount\":1,\"tabStripRatio\":0.5,\"tabStripVisible\":true,\"tabEditable\":true,\"newTabVisible\":true,\"referenceStyle\":0,
如何摆脱那些反斜杠?
我尝试了str_replace但它无法正常工作:
$myFile = $diretorio."/dados.json";
$fh = fopen($myFile, 'w') or die("não é possível abrir o ficheiro");
$stringData = $_POST['data'];
$stringData= str_replace('\\/', '', $stringData);
fwrite($fh, $stringData);
fclose($fh);