Can I combine the values in the database with an comma (,) instead of next line?
Can I combine the values in the database with an comma (,) instead of next line?
Cause I am using the following code to check in PHP if one thread match with another thread:
PHP Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php$id1='1,2,3,4,5,6,7,8,9,10';// the values from thread_field_data where tid=1
$id2='10,11,12,13,14,15,16';// the values from thread_field_data where tid=2
// splitting them up into an array
$one= explode(',',$id1);$two= explode(',',$id2);// making the check
$result= count(array_intersect($one,$two));if($result>0){echo'Something matched!';}?>