<?php
$methods = array(
'POST',
'GET',
'POST',
'OPTIONS',
'TRACE',
'HEAD',
'OPTIONS',
'OPTIONS',
'OPTIONS',
'PATCH',
'DELETE',
);
$matched_methods = array();
foreach ($methods as $method) {
if (strcasecmp($method, 'POST') === 0
|| strcasecmp($method, 'GET') === 0
|| strcasecmp($method, 'OPTIONS') === 0) {
$matched_methods[] = $method;
}
}
var_dump($matched_methods);
preferences:
41.07 ms | 402 KiB | 5 Q