摘要:
值常量描述PHP 1 E_ERROR 运行时致命的错误。不能修复的错误。停止执行脚本。 2 E_WARNING 运行时非致命的错误。没有停止执行脚本。 4 E_PARSE 编译时的解析错误。解析错误应该只由解析器生成。 8 E_NOTICE 运行时的通知。脚本发现可能是一个错误,但也可能在正常运行脚 阅读全文
posted @ 2024-04-11 17:38
珊瑚贝博客
阅读(44)
评论(0)
推荐(0)
摘要:
preg_match('/^[\w\-\.]+@[\w\-]+(\.\w+)+$/',$email); 更多:https://www.shanhubei.com/archives/55206.html 阅读全文
posted @ 2024-04-11 17:04
珊瑚贝博客
阅读(15)
评论(0)
推荐(0)
摘要:
方法1:php内建函数 strip_tags()除去HTML标签 <?php header("content-type:text/html;charset=utf-8"); function strip_html_tags($str){ $pattern = '/<("[^"]*"|\'[^\']\ 阅读全文
posted @ 2024-04-11 15:56
珊瑚贝博客
阅读(162)
评论(0)
推荐(0)
摘要:
<?php header("content-type:text/html;charset=utf-8"); $script = "以下内容不显示:<script type='text/javascript'>alert('cc');</script>"; $pattern = '/<script[^ 阅读全文
posted @ 2024-04-11 15:45
珊瑚贝博客
阅读(37)
评论(0)
推荐(0)
摘要:
<?php function releative_path($path1,$path2){ $arr1 = explode("/",dirname($path1)); $arr2 = explode("/",dirname($path2)); for ($i=0,$len = count($arr2 阅读全文
posted @ 2024-04-11 15:15
珊瑚贝博客
阅读(16)
评论(0)
推荐(0)
摘要:
<?php function tree($arr,$pid=0,$level=0){ static $list = array(); foreach ($arr as $v) { //如果是顶级分类,则将其存到$list中,并以此节点为根节点,遍历其子节点 if ($v['parent_id 阅读全文
posted @ 2024-04-11 15:00
珊瑚贝博客
阅读(10)
评论(0)
推荐(0)
摘要:
本文主要介绍的是php使用函数pathinfo() 、parse_url()和basename()解析URL的实例代码,下面话不多说,直接来看代码 实例代码如下: 1、利用pathinfo解析URL <? $test = pathinfo("http://localhost/index.php"); 阅读全文
posted @ 2024-04-11 11:46
珊瑚贝博客
阅读(169)
评论(0)
推荐(0)
浙公网安备 33010602011771号