Hi,
I got the arrays, converted them to string and using pathinfo['basenames'] got the image names. Now I'm not sure how to do a string comparison.
What I have:
$str1 (a1.gif, a2.gif, a3.gif)
$str2 (a1.gif, a2.gif, a4.gif)
$str3 (a1.gif, a2.gif, a5.gif)
$str4 (a1.gif, a2.gif, a6.gif)
Desired result should be:
Matched: a1.gif, a2.gif
Non-matched: a3.gif, a4.gif, a5.gif, a6.gif
I tried the code below but it returned "matched" on all images including ones that don't match. Since $str1 are images from the image folder I want to use $str to compare against the other strings ($str1 to $str3, $str1 to $str2, etc). Any suggestions on how to do this? Thank you!
if(strcmp($str1, $str2)){
echo 'matched';
}else{
echo 'no matched';
};