Monthly Archives: June 2011

JavaScript Tutorial – What is JavaScript ?

What is JavaScript ? JavaScript is a client-side scripting language. This means the web surfer’s browser will be running the script. JavaScript is not a stand-alone language, but rather a scripting add-on to HTML. JavaScript is added to HTML commands

Posted in Javascript Tagged with:

PHP htmlentities () Function

htmlentities() – Convert all applicable characters to HTML entities! ENT_COMPAT – will convert double-quotes and leave single-quotes alone. ENT_QUOTES – will convert both double and single quotes. ENT_NOQUOTES – will leave both double and single quotes unconverted. You may refer

Posted in Php

PHP htmlspecialchars() Function

The htmlspecialchars() function converts some predefined characters (<, >, single quote ‘, double quote " and ampersand) to HTML entities. htmlspecialchars($string,$quotestyle) $string – Required. Specifies the string to convert $quotestyle – Optional. Specifies how to encode single and double quotes.

Posted in Php

PHP nl2br() Function

It replaces all new line characters in a string with HTML BR tags. The nl2br() function inserts HTML line breaks (<br>) in front of each newline (\n) in a string. Example: <?php echo nl2br("first line.\nsecond line."); ?> The output of

Posted in Php

PHP trim

trim() – Trimming White Spaces in variable. The trim() function removes white spaces and other predefined characters from both sides of a string. For example consider this, <?php $space = " username "; $strcount = strlen($space); print $strcount; ?> It

Posted in Php