我有一个叫做$availability
可以有四个选项之一,但也可以有多个由管道分隔的值:|
.
例如,该值可以是:severaltimes_week|oncetwice_month|occasionally
.
我还没有找到适合这个问题的比较运算符,哪一个最有效?
if ( $_GET[\'ava1\'] == "on" ) { $availability .= "severaltimes_week| "; }
if ( $_GET[\'ava2\'] == "on" ) { $availability .= "oncetwice_week| "; }
if ( $_GET[\'ava3\'] == "on" ) { $availability .= "oncetwice_month| "; }
if ( $_GET[\'ava4\'] == "on" ) { $availability .= "occasionally"; }
$meta_args[] = array(
\'key\' => \'availability\',
\'value\' => $availability,
\'compare\' => \'IN\'
);