Ok I have a foreach loop and wanted to know if I could get the last iteration data value for the current iteration?
Code:
foreach($array as $key=>$data) {
echo "Key: ".$key." Data: ".$data."<br />";
}
Results:
Key: 0 Data: 23244
Key: 0 Data: Program ID: 39-1-1499-1
Results I would like:
Key: 23244 Data: Program ID: 39-1-1499-1
is there a way to get the key on the current iteration as the data from the last?