I am creating a school Software in PHP and I have a couple of subject ids which were implored using the implore() function and inserted in the db, delimited by commas(,).I retrieved them and they are a string e.g when I var_dump it's showing that it's a string.
Example:
$subjId = $class_data['subject_ids'];
var_dump($subjId) // string(6) "9, 4,5,"
Note that it's commas are also counted.
How do I use each number in the string, or convert the string into an integer array? I want to match each number to its respective subject from a subjects table and then output the subject names.