我需要在保存到数据库表之前检查输入值。
我有一个域,我想检查 url 字段中插入的链接。如果 url 使用列表验证中的域之一,则为 true 否则为 false。
前任。
$urls = array('domain.com','domain2.com','domain3.com');
在 url 字段中将放置链接 ex (domain2.com/priflie/1234 OR domain.com/profile/4321)
我试过这个,但没有用
if (in_array($url, $urls))
{
// error code here
}
偶然的你