I have a little project going and since I am not the best at OOP I have come here for some help. I have a class called "truckinfo"
class truckinfo
{
public $vendor;
public $truckcount;
public $plate;
}
now I get the information like plate or vendor from somewhere else, and then display the truck in a list. I plan on creating the list somewhat like this
for($i = 0; $i < 3; $i++){
$truck = new truckinfo();
$truck->plate = "abc" . $i;
$truck->truckcount = $i + 5;
echo $truck->truckcount;
}
My question is, is it possible after displaying all the trucks to get the information from the first truck (in this case truck with plate "abc0") or can I only get the info for the latest one that got into the loop?
Thank you in advance.