自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

wang_huan2011的专栏

Code is Poetry...

  • 博客(3)
  • 资源 (1)
  • 收藏
  • 关注

原创 PHP实现文章定时发布设置

<?php /*获取文章的发布信息 * * 第一次使用需手动创建/lcookie/taiyuan_article_statistic.txt文件。 * 文件格式为: * //警告!警告!警告!警告!警告!警告!警告!警告! //手动更改或删除此文件会导致太原网文章预签发时间错误!将造成严重损失!如若更改后果自负!!! //警告!警告!警告!警告!警告

2013-08-21 15:04:10 4595

原创 PHP正则分步过滤文章中的超链和文字链接,同时保留包含有图片的超链、远程引入的js脚本、独立的图片等链接

PHP正则分步实现:过滤文章中的超链和文字链接,同时保留过滤掉的超链中的文字,保留包含有图片的超链、远程引入的js脚本、独立的图片等链接。例如:把我过滤了好吗<img src="http://baidu.com" />http://baidu.com(注:加删除线的为将要被过滤的代码)<?php $article['content'] = <<< HTML把我过滤了好吗http

2013-08-20 22:27:18 1288

原创 对一组数字排序,最大的放第一位,最小的放第二位,第二大的放第三位,第二小的放第四位,依次类推

$arr = array(1,7,3,10,5,6,2,8,9,4);$arr_len = count($arr);for ($i = 1; $i {if ($i%2 == 1)//根据次数判断取最大还是最小{for ($start_index = $i - 1,$max_index = $start_index,$j = 1; $j {$current_index

2013-08-16 23:45:05 1335

PHP的JSON扩展源码实现(json-1.2.1)

PHP的json_encode函数和json_decode函数的C语言实现。 C语言是非常强大的,众所周知PHP、MySQL、Apache等等都是由C语言开发然后编译而成的。本源码是PHP的JSON扩展的C语言源码实现。如果你是PHPer,你将更深入的了解C语言是如何强大,也会对PHP的底层代码实现有更深入的了解,这对我们技术的提高有很大帮助。。。 以下为英文介绍: json 1.2.0 ========== This extension implements the JavaScript Object Notation (JSON) data-interchange format as specified in [0]. Two functions are implemented: encoding and decoding. The decoding is handled by a parser based on JSON_checker[1] by Douglas Crockford. Function overview ----------------- string json_encode ( mixed value ) json_encode returns a string containing the JSON representation of value. value can be any type except a resource. mixed json_decode ( string json, [bool assoc] ) json_decode takes a JSON string and converts it into a PHP variable. When assoc is given, and evaluates to TRUE, json_decode() will return any objects as associative arrays. Example usage ------------- $arr = array("a"=>1,"b"=>2,"c"=>3,"d"=>4,"e"=>5); echo json_encode($arr); ---> {"a":1,"b":2,"c":3,"d":4,"e":5} $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json)); ---> object(stdClass)#1 (5) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) ["d"]=> int(4) ["e"]=> int(5) } $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json, true)); ---> array(5) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) ["d"]=> int(4) ["e"]=> int(5) }

2013-08-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除