How to define data from database if i have in database table this as result s,d,r,t
?
Here is the screen from table
I can do this if i have only s in database
if($func->data =='s') {echo "This is S";}
I need to define every letters in table and echo result, but how ? if i have more than one letters how i can do this?
This seems to be what you want:
$letters = explode(',', strtolower($func->data));
if (in_array('s', $letters)) echo 'This is S';
if (in_array('d', $letters)) echo 'This is D';
if (in_array('r', $letters)) echo 'This is R';
if (in_array('t', $letters)) echo 'This is T';
if (in_array('e', $letters)) echo 'This is E';
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.