PHP and iControl REST
Updated Jun 06, 2023
Version 2.0Was this article helpful?
Hi Santosh, The functions and methods return PHP variables because I used the json_decode method on the returned JSON. So the returned data is an object that contains an array. Therefore you can manage the array by using foreach on the array eg:
$handle = curl_init();
$icr = iCR($handle,"admin","admin","GET","https:///mgmt/tm/ltm/pool")
foreach ($icr->items as $i=>$v) {
echo "Pool name:$v->name
";
}
If you want to retrieve the JSON, I suggest you use json_encode or alternatively change the code of the methods to return the JSON, although I can't see what using the JSON instead of the standard PHP functions will give you.