php

\b is kind of special, it is not a character, neither a class of characters. It represents a change from a word character(letters, numbers, underscore) to a non-word character(or end […]

First, note that the function name is getElementById, not getElementByID, or getElementsById. Second, this function is a member of DOMDocument, not DOMElement. If you get a DOMElement parent and try […]

stripslashes is used to strip backslashes from a string, i.e., stripslashes(“\\e”)===”e” stripslashes(“\\n”)===”n” stripslashes(“\n”)===”\n” //there is no backslash in the string. stripcslashes almost does the same thing as stripslashes except it […]

SimpleXMLElement is used to represent an XML element.  The typical usage is: $resp = simplexml_load_file($httpcall); $resp->somechild;   Note that somechild is the tag name of a child of the XML […]

We know that a variable will be substituted with its value in a “” delimited string such as: $var1=”var1″; echo “this is $var1″; will print “this is var1″. This variable […]

I had a case to use regexp to match unicode codes of chinese characters. The unicode codes are of the form \uxxxx where x is hexidecimal digit. To match them, […]

In a php file, you can define a string using ” ” or ‘ ‘. You specify what characters the string consists of in between ‘ ‘ or ” “such […]

The return value of explode function is obvious in most cases, for example: $ar=explode(“\n”,”a\nb”) return an array that has two elements: $ar[0]=’a’,$ar[1]=’b'; But sometimes the return value may cause confusion. […]

$timestamp=gmmktime(22,50,0,2,10,2015); It considers Oct 10,2015,22(hour):50(minute):0(second) is the GMT time. It calculates the seconds between this time and GMT Jan 1,1970,0:0:0.   $timestamp=mktime(22,50,0,2,10,2015); It looks for the time zone settings in […]