- Products
- Learn
- Local User Groups
- Partners
- More
MVP 2026: Submissions
Are Now Open!
What's New in R82.10?
Watch NowOverlap in Security Validation
Help us to understand your needs better
CheckMates Go:
Maestro Madness
Hi guys, literally tearing my hair out here (don't have much to start off with). But working with PHP to pull data from the webapi using CURL. This all works great as long as there is under 500 objects, soon as I go over the 500 object mark I'm unable to merge the arrays successfully to output a unified data view.
Any ideas on the best way to do this, I believe the issue is that we've got multi arrays { [objects] [to] [from] [total] } I tried deleting the to/from/total and merging but was unsuccessful.
Any help would be much appreciated 🙂
Curious why are you trying to create a single JSON output.
And how precisely is it failing when you try and do so.
Hi phoneboy I have a list of IP addresses that I need to compare the database against, this would be very easy in 1.8API with the filter command.
My thoughts were to save me constantly pulling the objects, too store them in 1 big json array for processing, this is just one example and may need to be done on regular occasions hence building a tool for it.
I can that the second load of objects are being successfully pulled from the mds via a var_dump of the functions return, but array_merge just isn't working. I've tried json_decode before merge them json_encode after and the other way around but it's not wanting to go in and array size stays at 500, or it wipes out the array completely (that could have been a typo) as I was trying lots of things.
Actually, that's a very good reason for creating a merged JSON file 🙂
I believe you can use jq to do this like so:
jq -s '.[0] * .[1]' 1.json 2.json
anyway you can think of how to do this in PHP? This is my current loop, excuse the messiness of the code.
do
{
if(!isset($mergedArrays))
{
$mergedArrays = array();
$mergedArrays = json_decode(runAPI_Command($ip,$domainsid,$domain,$actions,$currentPosition),true);
$totalObjects = $mergedArrays["total"];
$currentPosition = $mergedArrays["to"];
}
else
{
$output = json_decode(runAPI_Command($ip,$domainsid,$domain,$actions,$currentPosition),true);
$currentPosition = $output["to"];
$mergedArrays = array_merge($output["objects"],$output["to"],$output["from"],$output["total"]);
}
$currentPosition = $mergedArrays["to"];
$size = sizeof($mergedArrays["objects"]);
echo "<br>Total Objects:$totalObjects <br>";
echo "Current Position:$currentPosition<br>";
echo "Size of Array:$size";
} while ($currentPosition < $totalObjects);
Unfortunately, I'm not as familiar with PHP.
That said, there is a JQ module for PHP, maybe that will help here?
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 4 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
Tue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsTue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY