Hi,
I’m beginner at this and i have question…
How can i foreach it
[{“Id”:0,“Name”:“default”,“Server”:“127.0.0.1”,“Status”:2}]
Hi,
I’m beginner at this and i have question…
How can i foreach it
[{“Id”:0,“Name”:“default”,“Server”:“127.0.0.1”,“Status”:2}]
<?php
$str = '[{"Id":0,"Name":"default","Server":"127.0.0.1","Status":2}]';
$obj = json_decode($str);
foreach($obj as $item)
foreach($item as $k => $v)
{
echo "$k : $v";
}