Skip to content

Commit

Permalink
strip trailing whitespace from server.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zpao committed Feb 6, 2015
1 parent 223ccb3 commit 76552e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function routeRequest()
case '/comments.json':
if($_SERVER['REQUEST_METHOD'] === 'POST') {
$commentsDecoded = json_decode($comments, true);
$commentsDecoded[] = ['author' => $_POST['author'],
$commentsDecoded[] = ['author' => $_POST['author'],
'text' => $_POST['text']];

$comments = json_encode($commentsDecoded);
file_put_contents('_comments.json', $comments);
}
}
header('Content-Type: application/json');
echo $comments;
break;
Expand Down

0 comments on commit 76552e3

Please sign in to comment.