我有visit.json
{
"vid.1":"1",
"vid.2":"1",
"vid.3":"1",
"vid.4":"1",
"vid.5":"1"
}
和一个php页面
<?php
$urlmovie = "visit.json";
$movie = file_get_contents($urlmovie);
$visit = 'vid.4';
$array=json_decode($movie,1);
$vis=$array [$visit];
$visitplus = $vis+1;
// some coding here to save visit.json "vid.4":".$vis+1." every time is access
echo $visitplus;
?>
如何用$ visitplus替换vid.4的值!