php中url地址合法性检测函数
栏目:php教程时间:2014-03-31 23:19:56
一个实例的php中url地址验证函数,代码如下:
-
-
-
-
-
-
- function CheckWebAddr($C_weburl)
- {
- if (!ereg("^http://[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*$", $C_weburl))
- {
- return false;
- }
- return true;
- }
------分隔线----------------------------
------分隔线----------------------------