It se开发者_Go百科ems like there would be a shorter way of writing this:
if ($action == 'add' || $action == 'update' || $action == 'delete') {
// whatever
}
is there?
if (in_array($action, array('add', 'update', 'delete'))) {
// whatever
}
I prefer this form, since it is easier to maintain:
if(in_array($action, array('add', 'update', 'delete'))) {
}
精彩评论