I have a php comma seperated string
$string = (x,y,z)
I have a column in mysql that has items (y,z)
how do i compare the two and echo which items in $string are not in the column?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you want to compute differente in two comma separated strings.
Just convert your strings in to array using
explodeand usearray_diffarray_diff– Computes the difference of arraysExample :
Be aware Values are compared using ===, so 1 and “1” are considered different.