Last active
February 11, 2020 22:50
-
-
Save yutakatsuchida/a6f5161b27accb121b2150dcac3dc6e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
// Method 1 | |
$json = file_get_contents('php://input'); | |
$json = mb_convert_encoding($json, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN'); | |
$arr = json_decode($json,true); | |
echo "<pre>"; | |
print_r($arr); | |
echo "</pre>"; | |
// Method 2 - easier way | |
$arr = json_decode( file_get_contents( 'php://input' ), TRUE ); | |
echo "<pre>"; | |
print_r($arr); | |
echo "</pre>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment