I've got an issue. I had a part of code.
foreach ($query->result() as $server)
{
//Prepare host and port to pass to mon script
list($host, $port) = explode(':', $server->address);
$GS = new Source($host, $port);
$result[$server->id]['id'] = $server->id;
if(!$result[$server->id] = $GS->get_details())
unset($result[$server->id]);
}
Inside this loop i have array width ID number:
$result[$server->id]['id']
After this i have this:
if(!$result[$server->id] = $GS->get_details())
unset($result[$server->id]);
This code checks if server online and destroy empty array. It generate new array, that rewrite my array, created before.
So how i can merge this two arrays in loop with minimum code? thanx.