不可能。您可以同时执行这两项操作,但可能没有单行操作那么理想:
$verify = (empty($var)) ? \'current_value\' : $var;
checked( $verify, $current );
也可以创建自定义函数:
function better_checked($check, $current, $echo = true) {
$result = \' checked="checked"\';
if ( ( $check != \'\' && $current != \'\' ) && ( (string) $check !== (string) $current ) )
$result = \'\';
if ($echo)
echo $result;
return $result;
}