会员
周边
众包
新闻
博问
闪存
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
在下刘彦直
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
12
下一页
2017年10月29日
php 正则匹配出a标签级a标签中的内容
摘要: <?phpheader("Content-type: text/html; charset=utf-8"); $str=file_get_contents("https://www.cn-teacher.com/kf/"); //拿出网页中所有《a》标签放到数组$reg1="/<a .*?>.*?<
阅读全文
posted @ 2017-10-29 13:55 在下刘彦直
阅读(19418)
评论(1)
推荐(1)
2017年10月28日
php正则表达式 匹配中文【正确版本】
摘要: <?php$str = "tjt如果日国际日国际软件grg给rhh";/* if (preg_match("/^[\x{4e00}-\x{9fa5}]+$/u",$str)) {print("该字符串全部是中文");} else {print("该字符串不全部是中文"); */ preg_match
阅读全文
posted @ 2017-10-28 21:34 在下刘彦直
阅读(881)
评论(0)
推荐(0)
换行显示print_r($arr);打印结果显示:Array( [0] => 百度 [1] => 阿里)
摘要: 数组array是非常重要的数据类型。相对于其他的数据类型,它更像是一种结构,而这种结果构可以存储一系列数值。数组能够在单一变量名中存储许多值,并且能够通过引用下标号来访问某个值。 在 PHP 中,有三种数组类型: 索引数组 - 带有数字索引的数组 关联数组 - 带有指定键的数组 多维数组 - 包含一
阅读全文
posted @ 2017-10-28 09:56 在下刘彦直
阅读(5407)
评论(0)
推荐(0)
2017年10月26日
数组中同时操作两个变量的方法 利用for循环加foreach遍历
摘要: //这是一个for循环测试 $arr=array('a'=>"a1",'c'=>"caa",'d'=>"da",'e'=>"da"); $str1="1,2,3,4"; $str="是,而且,要,觉"; $strarr=explode(',',$str); $strarr1=explode(',',
阅读全文
posted @ 2017-10-26 00:26 在下刘彦直
阅读(4383)
评论(0)
推荐(0)
2017年10月21日
php 图片上传之利用form表单上传
摘要: 、利用form表单上传此种方式是最原始的上传方式,前端就是简单的form表单,后端我们有PHP处理传输过来的文件。首先看前端的代码 upload.html 1 2 3 4 <form action="handle.php" name="form" method="post" enctype="mul
阅读全文
posted @ 2017-10-21 07:25 在下刘彦直
阅读(1500)
评论(0)
推荐(0)
2017年7月26日
PHP判断域名是否存在指定文件,不存在就301到其他
摘要: $domaintxt=file_get_contents(path ."/host/host.txt"); $yum=$_SERVER['HTTP_HOST']; $ymz=explode('.', $yum); if(!stristr($domaintxt,$ymz[count($ymz) - 2
阅读全文
posted @ 2017-07-26 17:43 在下刘彦直
阅读(375)
评论(0)
推荐(0)
iis伪静态写法
摘要: <rule name="rD"> <match url="^$" /> <action type="Rewrite" url="index.php" /> </rule> <rule name="rP"> <match url="^.*?/$" /> <action type="Rewrite" u
阅读全文
posted @ 2017-07-26 14:29 在下刘彦直
阅读(548)
评论(0)
推荐(0)
IIS 伪静态下 利用PHP获取 网址后缀
摘要: $_SERVER['HTTP_X_ORIGINAL_URL'];
阅读全文
posted @ 2017-07-26 10:31 在下刘彦直
阅读(272)
评论(0)
推荐(0)
2017年7月15日
mysql 替换某个字段中的某个字符
该文被密码保护。
阅读全文
posted @ 2017-07-15 18:37 在下刘彦直
阅读(3)
评论(0)
推荐(0)
2017年7月14日
php 获取根域名 并301跳转www域名
摘要: <?php$_zjt = $_SERVER['HTTP_HOST'];$_xxurl = explode(".",$_zjt);$urlqz = $_xxurl[0];$_xxurl = array_reverse($_xxurl);$urlhz = $_xxurl[1].".".$_xxurl[0
阅读全文
posted @ 2017-07-14 18:02 在下刘彦直
阅读(1224)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
12
下一页
公告