Blog Archives

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

PHP strip_tags() Function

The strip_tags() function strips a string from HTML, XML, and PHP tags. It takes two parameters: the string to perform the action on and the specified html tags NOT to strip out. This is a useful function to prevent users

Posted in Php

PHP substr() Function

The substr() function returns a part of a string. substr() is used to get part of a string. The part of the string to be returned is specified as a range using the start and length arguments. If start is

Posted in Php

PHP str_replace() Function

The str_replace() function replaces some characters with some other characters in a string. str_replace — Replace all occurrences of the search string with the replacement string str_replace ( $search ,$replace , $string, $count) $search – Required. Specifies the value to

Posted in Php

PHP strpos() Function

The strpos() function returns the position of the first occurrence of a string inside another string. strpos — Find position of first occurrence of a string If the string is not found, this function returns FALSE. Syntax: strpos($string,$needle,$start) $string –

Posted in Php

PHP file Delete

The php unlink() function is used to delete or destroy files. This function returns TRUE on success, or FALSE on failure. $myFile = “testfile.txt”; $return = unlink($myFile); if(!$return) { echo (“Error deleting on $myFile”); } else { echo (“Deleted $myFile”);

Posted in Php