Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute PHP Online

<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
  error_reporting(E_ALL);
ini_set('display_errors', 1);
$strArr = [
    'name'=>"test",
     'is_feature'=> "0",
     'attributes'=>[[5=> "blue"],[7=> "iOS"]],
     'cost'=> "2000"
];
$str = json_encode($strArr);
$arr = (array) json_decode($str);
$att = (array) $arr['attributes'];
foreach($att as  $v) {
    foreach($v as  $k=>$z) {
    echo "key: ".$k." and val: " . $z . PHP_EOL;
    }
};
?>
</body>
</html>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.