Yes you can. array_map
can be passed multiple parameters, each of which is an array with the values you need to pass to the callback function. So in this case you need an array of connections and an array of sqls.
You can use array_fill
to make an array with copies of the same connection (for objects, only the reference is copied, so you won't have multiple actual connections to the database).
Then, this should work:
<?php
$connections = array_fill(0, count($sqls), $connection);
array_map('mysqli_query', $connections, $sqls);
To make it a bit more understandable, I'd wrap this in a function.
function mysqli_query_multiple($connection, $sqls)
{
$connections = array_fill(0, count($sqls), $connection);
array_map('mysqli_query', $connections, $sqls);
}
Or maybe it's just as easy and readable to use a for loop.