I have a question about the general functionality of PHP that I haven’t been able to get a good, clean, simple answer on.
Say I have a class, student. And I create an array called Students that contains instances of the class student. How would I go about iterating through that array and pulling, say, StudentID off each of the student class instances? Thanks for the support!
If I understand correctly, you have a class like this:
And an array like this:
To get the StudentId of each, simply iterate through the array like any other normal array iteration: