php

Since space is not allowed in a url, the following html is illegal in syntax: <a href=”http://myprogrammingnotes.com/test.php?p=var1 + var2″>click me</a> However, if you open that html in firefox, you will […]

$dom = new DOMDocument(); $dom->load(“test.xml”); $text=$dom->getElementsByTagName(“Name”)->item(0)->nodeValue; The above code lines get the text between <Name></Name> Suppose the text between the tags is: <Name>http://myprogrammingnotes.com/index.php?p1=value1&amp;p2=http%3A%2F%2Fgoogle.com</Name> what would $text be? Is $text “http://myprogrammingnotes.com/index.php?p1=value1&amp;p2=http%3A%2F%2Fgoogle.com” […]

\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, […]