SOsample21Nov2021 - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of SOsample21Nov2021.php
- <?php
- //$json = file_get_contents("./user-data.json");
- $json='[{
- "user":"admin",
- "password":"admin"
- },
- {
- "user":"login",
- "password":"login"
- },
- {
- "user":"stackoverflow",
- "password":"goodpassword"
- }
- ]';
- $json_data = json_decode($json, true);
- foreach ($json_data as $key=>$getdata) {
- echo $getdata["user"] . "-" . $getdata["password"];
- echo "<hr>";
- }
- ?>