I've following array of file extensions titled $aSupportedImages
:
Array
(
[0] => jpeg
[1] => jpg
[2] => gif
[3] => png
)
I've another array titled $values
as follows :
Array
(
[vshare] => Array
(
[course_error.png] => Array
(
[0] => https://www.filepicker.io/api/file/Y0n99udSqS6ZJWYeYcUA
)
[before_login.png] => Array
(
[0] => https://www.filepicker.io/api/file/19FWbHh1QNGCo2OINxI6
)
[Sample_1.docx] => Array
(
[0] => https://www.filepicker.io/api/file/INjMeEhCSjpZSfZJmQUb
)
)
)
Now you can see that each key in an array [vshare]
is a file name. I want to check the extension of each of such file with the extensions present in an array $aSupportedImages
. If any of the files have different extension than those present in the array $aSupportedImage
the loop should get break and it should return false.
In above case for third file it should return false. As .docx is not present in an array $aSupportedImages
How should I do this? Please help me.