I have an array of objects, each object contains a bunch of values, two of which are an int and a string. I need to loop over the objects and pull out the string and int and place them into an associative array, where each string associates with each int. How would I go about doing this?
This is what I have so far:
foreach( $fileobject as $p ) {
$program_number = $p['number'];
$filename = $p['InputFile']['filename'];
}
$fileobject is the array of objects. 'number' is the int, and 'filename' is the string. What is the syntax for putting the 'number' and 'filename' together into an associative array. There are undetermined amount of objects in the initial array.