0
請問有人可以幫忙用這行嗎?如何修改它只允許一個-Z,0-9? 謝謝。只允許a-Z,0-9使用preg_match,preg_replace
if (preg_match('~[<>&"\'=\\\]~', preg_replace('~&#(?:\\d{1,7}|x[0-9a-fA-F]{1,6});~', '', $context['checked_username'])) != 0 || $context['checked_username'] == '_' || $context['checked_username'] == '|' || strpos($context['checked_username'], '[code') !== false || strpos($context['checked_username'], '[/code') !== false) $context['valid_username'] = false;