How can I pass specifically the number of 2 values from an array into a function then loop over the array and take the next 2 values from the array.
For example
<?php
$fileArray Array("file1", "file2", "file3", "file4", "file5", "file6", "file7", "file8", "file9", "file10")
function fileFunction($file1, $file2)
{
$dostuffhere;
}
[loop]
fileFunction($fileArray[$key], $fileArray[$key]);
[/loop]
?>
Note that the $fileArray can and will be longer than 10 items.
array_chunk() sounds like it’s the function you want if you are always going to have an even number of records or your function can work with just one parameter (please confirm this)
the array_chunk() function will split an array into indexed sub-arrays in collections of N
http://php.net/manual/en/function.array-chunk.php