我有我的变量$_GET['artist'],我想检查一下:
one一封信,这封信是从a到z(区分大小写,因此A是无效的);all或other如何在PHP 上regex和preg_match()PHP上检查它?
if (preg_match('/^([a-z]|all|other)$/', $_GET['artist']) === 1) {
// True
}
Run Code Online (Sandbox Code Playgroud)
假设all并且other也应该区分大小写.
| 归档时间: |
|
| 查看次数: |
1481 次 |
| 最近记录: |