0
我使用一個數組來存儲一個正則表達式是這樣的:貯藏中的regex陣列PHP
private $rules = ['usuario' => ['regexp' => "^(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$", 'length' => ['max'=>'30','min'=>'4']],
'email' => ['length' => ['max'=>'70','min'=>'5']],
'contrasena' => ['length' => ['max'=>'70','min'=>'4']]
];
當我嘗試:
echo '/' . $this->rules['usuario']['regexp'] . '/';
我:
/^(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?
任何人都可以解釋這種行爲嗎?
查看源代碼,它都在那裏,它只是瀏覽器沒有顯示它 – 2015-11-20 03:22:47