Archive for September, 2009
Collection of 10 top 10 lists about web development
I am a regular reader of web development articles and in this process bookmark a lot of them. Out of that collection I present to you a list of 10 articles which themselves are lists of 10(tips, functions etc). Not all of them are top 10 but equally good. All these articles are [...]
Read the rest of this entry >>
Quick PHP Tip: How to parse CDATA sections using SimpleXML
Applies to: simplexml_load_string and simplexml_load_file
Problem : SimpleXML does not parse text inside CDATA tags in an XML.
Consider the XML below:
$str = ‘<rootNode>’;
$str.=’<childNode>some text goes here</childNode>’;
$str.=’</rootNode>’;
To parse it we use following syntax:
$xml = simplexml_load_string($str);
On printing it outputs:
SimpleXMLElement Object
(
[childNode] => some text goes here
)
Thats OK. Now the same xml but this time the [...]
Read the rest of this entry >>
javascript : 7 tips for better coding
1- Use short hand notation for declaring arrays and objects
Arrays and objects are declared as following:
var someArray = new Array();
var someObject = new Object();
There is a shorthand notation for declaring these which is much more easier to use. It can be used like this:
var someArray = [];
var someObject = {};
2- Use square bracket notation – [...]
Read the rest of this entry >>
Super simple way to expand bitly urls using PHP
OK. Agree that bit.ly provides an API for expanding URL’s. The main purpose of our simple exercise here is to use curl functions in PHP to achieve the same. We will write a simple function that will accept a bitly url as parameter. Then we will use curl to get the expanded url.
Below is the [...]
Read the rest of this entry >>
5 JSON resources for web developers
JSON(Javascript Object Notation) is defined as a lightweight data interchange format and fat-free lightweight alternative to xml. Since json is the native data form of Javascript, it can be used on the browser more easily then XML.
If you are a web developer who works with javascript/ajax a lot and still wondering what this json thing [...]
Read the rest of this entry >>

