PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
First, I know this should be easier than I have made it. I looked an tried other pieces of code from the net but can't seem to get my problem worked out. I have an xml that has been parsed into an array with the following:
foreach ($items as $load){
$contents[]= simplexml_load_file($load['guide']); //LOAD XML EACH CHANNEL
$control=[];
foreach ($contents as $content){
$control=array(
'start'=>$content->programme['start'],
'title'=>$content->programme->title,
'desc'=>$content->programme->desc,
);
}
}
So basically I have an array that list the start time, show title , and show description. Now I would like to parse that array grouping all show titles by start times so I end up with array something like where all shows for particular time fall into same array. Any help greatly appreciated
I am sure it can be done, but I don't know enough about PHP. I am posting all my code with hopes somebody can point me right direction. I am looping thru an xml, parsing a url where I have xml files stored, loading the xml, parsing out the start, title and desc into a control array. I then loop thru the start element comparing its value to the control, it the same it writes it to array along with title and desc. Finally I create one array of the start, title and desc, which will be saved to php array file. I am trying to group all titles (along with desc) by start.