$_POST['author'], 'text' => $_POST['text']]; $comments = json_encode($commentsDecoded, JSON_PRETTY_PRINT); file_put_contents('_comments.json', $comments); } header('Content-Type: application/json'); echo $comments; break; default: return false; } }
Maybe you like these: |
PHP改变当前工作路径 |
一段求相对路径的PHP代码 |
用PHP写Shell |
PHP经典代码 |
PHP数组小结 |
无觅 |