- 浏览: 141742 次
- 来自: ...
最新评论
-
love1989:
好东东 收藏
PHP多线程批量采集下载图片
文章列表
http://echarts.baidu.com/doc/example.html
shell 提取字符串
- 博客分类:
- Shell
cat a.txt | grep 'doPostBack' | awk -F ')' '{print $1}' | awk -F ',' '{print $2}' | tr -d "'"
如果不对文件,可以用echo
grep 定位到关键字所在行
awk 相当于php explode 分割
在a.txt找到 doPostBack这一行
awk -F ')' 以右括号作为分割符
'{print $1}' 分割好后取第一段
| 后面的都是对前面的字符串接着处理
tr -d "'" 去掉单引号
mysql 重复记录
- 博客分类:
- mysql
# 查询重复的记录,查找id重复的记录
Select id,Count(*) From news Group By id Having Count(*) > 1
#查找某个分类下 有多少条记录
Select id,catid,Count(*) From product where catid=180 Group By catid Having Count(*) > 0
PHP 过滤,替换 超链接
- 博客分类:
- PHP
#过滤掉超链接
ereg_replace("<a [^>]*>|<\/a>","",$content);
#清除包含指定关键词的超链接
$find="this string is my find";
$string='<font color="red">这段内容将要被替换掉</font>';//将超链接替换成的内容
echo ereg_replace('<a([^>]*)>([^<]*'.$find.'[^>]*)&l ...
将一个表的查询结果插入到另一个表中
- 博客分类:
- mysql
#如果表存在:
insert into tab1 select * from tab2;
#只导一个字段:
insert into tab1(id) select id from tab2 where catid=522;
#如果表不存在:
create table tab1 as select * from tab2;
在芸端首页:http://www.zyund.com
在芸端 RSS
在芸端
http://www.zyund.com
C:\xampp\apache\conf\httpd.conf 覆盖 Directory
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from allow
</Directory>
################################
C:\xampp\apache\conf\extra\httpd-vhosts.conf 里面加入以下代码
<VirtualHost *:80& ...
#对二维数组进行排序,$keys就是要排序的键名, 第三参数可以为 SORT_ASC
function array_sort($arr,$keys,$type=SORT_DESC){
$keysvalue = $new_array = array();
foreach ($arr as $k=>$v){
$keysvalue[$k] = $v[$keys];
}
array_multisort($keysvalue, $type, $arr);
return $arr;
}
用法示例:
$array = array(
array('name ...
一组PHP可逆加密解密算法
- 博客分类:
- PHP
对于大部分密码加密,我们可以采用md5、sha1等方法。可以有效防止数据泄露,但是这些方法仅适用于无需还原的数据加密。
对于需要还原的信息,则需要采用可逆的加密解密算法。
下面一组PHP函数是实现此加密解密的方法:
加密算法如下:
function encrypt($data, $key)
{
$key = md5($key);
$x =
Shell 如何按行读取文件并且解析行
- 博客分类:
- Shell
按行读取文件:
Java代码
while read myline
do
echo $myline
done < /etc/passwd
这段程序就是把输入文
http://sentsin.com/jquery/layer/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style>
table{border-collapse:collapse;border-top:3px solid #000;border-bottom:3px solid #000;}
.notVert{border:none; }
td,th{
width:60px;
border-right:1px solid #aaa;
borde ...
GoAccess命令
#下载GoAccess安装包
wget http://sourceforge.net/projects/goaccess/files/0.4.2/goaccess-0.4.2.tar.gz/download
tar zxvf goaccess-0.4.2.tar.gz
cd goaccess-0.4.2
./configure –enalbe-geoip –enable-utf8
make
make install
#goaccess -f /usr/local/nginx/logs/a.log -s -a -b
Lin ...