我已经四处寻找并找不到答案,或者也许这只是我json代码中的一些错误?
JSON file:
{
"html": {
"content": "<div style=\"background-color: rgb(255, 255, 255); height: 11px; width: 111px;\"></div>"
}
}
background-color: rgb(255, 255, 255); --> NO
background-color: #000000; --> OK
PHP:
$jsonPathSite = '/site/01.json';
$jsonFileSite = file_get_contents($jsonPathSite);
$jsonReadSite = jsonDecode($jsonFileSite,true);
// Saving the file
$jsonReadSite['html']['content'] = $content;
file_put_contents( $jsonPathSite, json_encode($jsonReadSite) );
无法保存为RGB格式?
但如果我使用HEX格式的json文件完全没问题!