When I try to read in the data I get this error but if I hardline the data it works just fine.
Warning: Invalid argument supplied for foreach() in ****EDIT******\json.php on line 8
<?php
if (isset($_POST['submitted'])) {
$jsondata = $_POST['json_data'];
// create object from string
$json_o = json_decode($jsondata);
// object method
foreach($json_o->roster as $name) //line 10
{
echo "{$name[0]}";
}
};
?>
<h1>EPGP Web</h1>
<form action="json.php" method="post">
<textarea rows="20" cols="80" name="json_data">Replace this with your data!</textarea>
<input type="submit" value="Submit"/>
<input type="hidden" name="submitted" value="TRUE" />
</form>
Warning: Invalid argument supplied for foreach() in ****EDIT******\json.php on line 8
<?php
if (isset($_POST['submitted'])) {
$jsondata = $_POST['json_data'];
// create object from string
$json_o = json_decode($jsondata);
// object method
foreach($json_o->roster as $name) //line 10
{
echo "{$name[0]}";
}
};
?>
<h1>EPGP Web</h1>
<form action="json.php" method="post">
<textarea rows="20" cols="80" name="json_data">Replace this with your data!</textarea>
<input type="submit" value="Submit"/>
<input type="hidden" name="submitted" value="TRUE" />
</form>