Last active
December 14, 2015 07:09
-
-
Save vejuhust/5048159 to your computer and use it in GitHub Desktop.
a json testing controller in CodeIgniter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Json_test extends Controller { | |
public function setter() { | |
$fp = fopen("/tmp/json_test.txt","w"); | |
$content = json_encode($_POST); | |
fwrite($fp, $content, strlen($content)); | |
fclose($fp); | |
echo $content; | |
} | |
public function getter() { | |
$result = file_get_contents("/tmp/json_test.txt"); | |
echo $result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment