替换旧的eregi函数PHP

时间:2015-04-29 11:58:32

标签: php preg-match eregi

我遇到问题需要修复这个旧的PHP eregi funxtion因为它使用了IN参数.. 它是来自Matthieu MARY的验证码生成class_log.php的脚本

旧代码:

<server>:<port>/.../process/[{"operationId":1,"command":"ZADD","gameId":"t5","key":"abc"}]

我尝试这个,但不确定是否正确?

$sMotif = "--$sIN ([a-zA-Z0-9]{3,4},)*([a-zA-Z0-9]{3,4}){1}";
if ((eregi("$sMotif ",$this->sParam))||(eregi("$sMotif$",$this->sParam))){
    $this->aParam['bExtension'] = TRUE;
    $this->aParam['aExtension'] = $this->_PARAM_get_extension($sIN);
    $this->aParam['inExtension'] = ($sIN=='e');
    $this->aParam['iParameters']++;
}

TNX

0 个答案:

没有答案