d
Amit DhamuSoftware Engineer
 

Case Insensitive In Array Check

1 minute read 00000 views
$extensions = ['avi', 'mkv', 'mp4', 'wmv', 'm4v'];

if (preg_grep('/mp4/i' , $extensions)) {
    // Returns true as mp4 is in the $extensions array
}