How to debug JavaScript in FireFox?

Firebug add-on makes debugging javascript code very easy. After installing firebug extension in firefox and opening a webpage, you can see a new menu item in the context menu of […]

If you do not use header() in your php script, what are the default http headers your browser gets? Here are the http headers php 5.4 generates in the response: […]

How to write a WordPress plugin?

What is wordpress plugin? A WordPress plugin is a php file in the directory wp-content\plugins\. Complex plugin may have multiple files and more complex directory structure. It can use a […]

Of course, you can put echo or print statements somewhere in the debugged php file to print some messages or value of variables. More convenient way is using an IDE […]

An array can be converted to an object in PHP. <?php $a=array(“aa”,”bb”); $a=(object)$a ?> However you can not access the member of $a because there is not a name for […]

strip_tags(“hello <p> world</p>”)–> “hello word” list($a,$b,$c)=$myarray; $a<=$myarray[0],$b<=$myarray[1],$c=$myarray[2] compact(“variablename1″,”variablename2″,…”) returns an array whose members are “variablename1″=>$variablename1, “variablename2″=>$variablename2, …. if $variablename is not in the current scope, compact won’t include it. array_rand($arr) […]

In the previous chapter, we know wp-settings.php is a complex file. This file loads almost everything like plugins and active theme. We will look into it further. After including plugin […]

dirname in php may not be what you think it to be: given a full path name of a file, return its directory part. In fact, dirname(pathname) returns the parent […]