Ok im trying to test if the name of the image beng uploaded already exists. If it does not then add its name to the image string.
$img1 = '02.gif';
$imgStr = '00.jpg,02.jpg,03.jpg';
However, the important part is its number. So lets remove the extension. Because we want to allow for the ability to change the image type.
$tmpImg = explode(".", $img1);
if( substr_count($imgStr, $tmpImg[0]) == 0 ){
// Add new item no match was found.
}
else{
// Check extension match was found
}
Now since we realize that 02 does infact exist. We need to check if its extension is the same as the entry in the $imgStr. If not replace the extension. What would be the best way to do this?
Thanks,
Jesse