wangyouworld 的所有文章

关于 wangyouworld

你为什么登山,因为山在那里。

在网上查了下资料感觉smarty3.0以上的配置很少,还且不详细,站长最近无意中发现一个博客中,有详细的smarty3.0以上配置,现在来推荐给大家,想学的可以仔细看下。
先介绍下其目录:

demo文件夹为示例文件。Libs为程序文件。

/libs/Smarty.class.php   #主文件

/libs/sysplugins/  #内部plugin

/libs /plugins/   #外部plugin,可自由扩充

/demo/cahce/   #放置缓存文件

/demo/configs /   #放置可以载入的配置文件

/demo/templates/   #放置模板文件

/demo/templates_c/    #放置对模板编译后的文件

继续阅读 关于smarty3.0版本以上的配置

/*
 * include() require()。
 * 这两种结构除了在如何处理失败之外完全一样。
 * include() 产生一个警告而 require() 则导致一个致命错误。
 * 换句话说,如果想在遇到丢失文件时停止处理页面就用 require()。
 * include() 就不是这样,脚本会继续运行。
 *
 * include_once() require_once()
 * 如果该文件中的代码已经被包含了,则不会再次包含。
 * 错误处理方式和include() require() 相同。
 */

继续阅读 PHP include include_once require require_once 区别

Highlight.js 语法高亮

Highlight.js 语法高亮(代码着色)可以使用在博客,论坛及任何网页上。它非常容易使用,因为它的工作原理:识别代码,检测语言,(高亮)着色处理。

它支持54种语言,并有26种风格主题。

相较于缺少行号显示;不确定是否支持源代码查看。不过,加上主题文件,仅95KB。 继续阅读 Highlight.js 语法高亮

使用PHP农历与公历互相转换类 ,主要实现了由公历计算农历 、由农历转公历等功能,通过这个类可以将单个日期转换公历或农历,同样支持整个月份的转换,即给定一个公历月份计算农历。(注:此类支持的年份范围是 1891年~2100年,如果超出此范围的年份将无法转换。此日期转换类暂时未实现节气和中国节假日。)

默认最小处理年份:1891
默认最大处理年份:2100 继续阅读 PHP农历与公历互相转换类

PHP is not limited to outputting html. PHP can output images, pdf, javascript files, etc. Browsers determine what type of content is by analyzing the headers sent. In this tutorial I will present you with some examples of how to send headers. To send PHP header use the function header(). You must call this function before any output. Use the function headers_sent() to check whether the headers have been sent and output started. 继续阅读 php常用的header:301,302, Redirects, 404, Javascript, Download, Authentication dialog Headers