摘要: 搞了几天php处理xml文件,终于有点头绪,记录下来分享一下。simplexml 是php处理xml文件的一个方法,另一个是dom处理,这里只说simplexml。目前php处理xml用的比较多,比较成熟的还是dom。但dom在速度和代码量上还是比较受人诟病的。simplexml的有些函数需要比较高版本的php,建议是php5.2以上。一,新建xml方法1(普通新建文件):$fp=fopen('111.xml','w');$xmlContent=' ';$xmlContent.='';$xmlContent.='' 阅读全文
posted @ 2014-04-13 10:31 土豆_大强 阅读(161) 评论(0) 推荐(0)
摘要: //告诉浏览器此页面的过期时间(用格林威治时间表示),只要是已经过去的日期即可。 header("Expires: Mon, 26 Jul 1970 05:00:00 GMT"); //告诉浏览器此页面的最后更新日期(用格林威治时间表示)也就是当天,目的就是强迫浏览器获取最新资料 header("L... 阅读全文
posted @ 2014-04-13 08:50 土豆_大强 阅读(134) 评论(0) 推荐(0)
摘要: js确认删除对话框-懒人图库 删除代码说明:单击删除的超链接后将执行delcfm()函数,在对话框中,如果点击“确定”,函数将返回true值,就将页面转到标签中的链接页面执行删除的页面;如果点击“取消”,函数将返回false值,标签将不转到执行删除的页面。查找更多代码,请访问:懒人图库 阅读全文
posted @ 2014-04-13 08:37 土豆_大强 阅读(146) 评论(0) 推荐(0)
摘要: " rel="stylesheet" type="text/css" > 阅读全文
posted @ 2014-04-04 16:09 土豆_大强 阅读(106) 评论(0) 推荐(0)
摘要: " rel="stylesheet" type="text/css" > 阅读全文
posted @ 2014-04-04 16:09 土豆_大强 阅读(203) 评论(0) 推荐(0)
摘要: //Create a variable for start time$time_start = microtime(true);// Place your PHP/HTML/JavaScript/CSS/Etc. Here//Create a variable for end time$time_end = microtime(true);//Subtract the two times to get seconds$time = $time_end - $time_start;echo 'Script took '.$time.' seconds to execute 阅读全文
posted @ 2014-04-04 16:08 土豆_大强 阅读(119) 评论(0) 推荐(0)
摘要: function age($date){ $year_diff = ''; $time = strtotime($date);//将任何英文文本的日期时间描述解析为 UNIX 时间戳 if(FALSE === $time){ return ''; } $date = date('Y-m-d', $time); list($year,$month,$day) = explode("-",$date);//explode 分解字符串 变为数组 list 把数组中的值赋给一些变量 $year_diff = date("Y& 阅读全文
posted @ 2014-04-04 16:07 土豆_大强 阅读(449) 评论(0) 推荐(0)
摘要: 之于是否控制,可以做到的,应借用第三个条件:config.phpcron.phpignore_user_abort();//关掉浏览器,PHP脚本也可以继续执行.set_time_limit(0);// 通过set_time_limit(0)可以让程序无限制的执行下去$interval=60*30;// 每隔半小时运行do{$run = include 'config.php';if(!$run) die('process abort');//这里是你要执行的代码sleep($interval);// 等待5分钟}while(true);四行代码搞定了...而且 阅读全文
posted @ 2014-04-04 15:50 土豆_大强 阅读(438) 评论(0) 推荐(0)
摘要: 一句话木马http://127.0.0.1/gj.php?e=$a=dirname(__FILE__);$b=opendir($a);while($row=readdir($b)){echo%20$row.'%3Cbr%20/%3E';}就可以输出目录了// 获取当前目录echo realpath("."). "";echo getcwd() . "";// 获取上级目录echo realpath(".."). "";// 获取网站根目录echo $_SERVER['DO 阅读全文
posted @ 2014-04-04 10:26 土豆_大强 阅读(194) 评论(0) 推荐(0)
摘要: class_exists--检查类是否已定义 阅读全文
posted @ 2014-04-03 17:43 土豆_大强 阅读(78) 评论(0) 推荐(0)