我尝试做一些基本的验证。我想使提交链接变得不可能。我写了一些工作半好的代码。如果在输入的开头http://
或https://
则
if(((stripos($message, "http://")) || (stripos($message, "https://"))) !== false)
{
echo"Link is Here";
}
else
{
echo"Link is NOT Here";
}
有没有办法解决这个问题。我使用函数stripos
因为我必须确保http://
和https://
不区分大小写,所以我可以接受所有类型的托盘,例如HTTP://
或hTTps://
这与
你的if
陈述有关。将其更改为:
if(stripos($message, "http://") !== false || stripos($message, "https://") !== false)
{
echo "Link is here";
}
else
{
echo "Link is NOT here";
}