I am creating a website for school.
I have the subjects of a student saved in a database.
It's get saved like this --> 1,2,3,6,7
This means student X does subject ID 1,2,3, 6 and 7
The subjects from one student get returned from a database in one variable $subjects I would like to output the Subject Name (subject names are also stored in the database). But since the variable that is returned in $subjects is not one subject, but multiple, I can't search for the subject name. Is it possible to convert $subjects to an array so that $subjects[0] would be 1 in my example and $subjects[1] would be 2 (see above @ it's get saved like this).
Simply said: it should not be $subjects = 1,2,3,6,7 but
$subjects[0] = 1
$subjects[1] = 2
$subjects[2] = 3
$subjects[3] = 6
$subjects[4] = 7
explode()