写HTML和CSS的新方法
div#page>div.logo+ul#navigation>li*5>a
<div id="page"> <div></div> <ul id="navigation"> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> </ul> </div>
div#page>div.logo+ul#navigation>li*5>a
<div id="page"> <div></div> <ul id="navigation"> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> </ul> </div>
在某个论坛上看到有人在问——“Which programming language should I learn first?”,看到了下面的这个回答,有点意思。
Depends.
- To program in an expressive and powerful language: Python
- To get a website up quickly: PHP
- To mingle with programmers who call themselves “rockstars”: Ruby .
- To really learn to program: C .
- To achieve enlightenment: Scheme .
- To feel depressed: SQL
- To drop a chromosome: Microsoft Visual Basic
- To get a guaranteed, mediocre, but well paying job writing financial applications in a cubicle under fluorescent lights: Java .
- To do the same thing with certifications and letters after your name: C#
- To achieve a magical sense of childlike wonder that you have a hard time differentiating from megalomania: Objective C
I could go on… but I’m not feeling hateful enough today.
翻译如下:
下面是九个PHP中很有用的功能,不知道你用过了吗?
你可能知道PHP允许你定义一个默认参数的函数。但你可能并不知道PHP还允许你定义一个完全任意的参数的函数
下面是一个示例向你展示了默认参数的函数:
// 两个默认参数的函数 function foo($arg1 = '', $arg2 = '') { echo "arg1: $arg1\n"; echo "arg2: $arg2\n"; } foo('hello','world'); /* 输出: arg1: hello arg2: world */ foo(); /* 输出: arg1: arg2: */
现在我们来看一看一个不定参数的函数,其使用到了?
func_get_args()
方法:
…