Suppose I have a PHP array of file names like $f = [ 'file1.jpg', file2.png', 'file3.bmp', 'file4.zip', 'file5.txt'... ];
Now how do I remove all the files from the array with not allowed extension, in this case remove everything except .jpg and .png ?