In my SQL database I have a query that turns values in multiple rows into a single concatenated string.
id | image_filename | slides | languages | types
-------------------------------------------------------------------------
10 | filename.jpg | 55,4 | 1 | TN,CQ
In PHP I am trying to check to see which slides this image is associated with. If it is associated, that checkbox will be checked.
$isChecked = (strpos($slide,"5") !== false) ? " checked=\"checked\"" : "";
The problem is that the statement above will return true because there is a 5 contained in there. What needs to happen is it will return false because 5 does not equal 55.
How can I create something in PHP to check the values before each comma, and see if it matches a certain string that I can specify.
Thanks!