PHP 验证IFSC是否合法


正则匹配验证IFSC是否合法

/**
 * 验证IFSC是否合法
 * @param $ifsc string
 * @return bool
 */
function is_ifsc($ifsc): bool
{
    $money_reg = '/^[A-Za-z]{4}0[A-Z0-9a-z]{6}$/';
    if(!preg_match($money_reg, $ifsc)){
        return false;
    }
    return true;
}


云天阁
非我而当者,吾师也;是我而当者,吾友也;谄谀我者,吾贼也。
搜索