Skip to main content


Showing posts from June, 2014

Interview Questions For PHP

    •    What is PHP? PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites.Even a non technical person can cretae sites using its CMS.WordPress,osCommerce are the famus CMS of php.It is also an object oriented programming language like java,C-sharp etc.It is very eazy for learning     •    What is the use of "echo" in php? It is used to print a data in the webpage, Example: <?php echo 'Car insurance'; ?> , The following code print the text in the webpage     •    How to include a file to a php page? We can include a file using "include() " or "require()" function with file path as its parameter.     •    What's the difference between include and require? If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution wi

First Jquery Program

<html>     <head>          <script src="as.js"> </script>                  <script> $(document).ready(function(){ $('button').click(function() { $('p').hide(); }); }); </script>                                   </head>          <body>            <p>Hi Click ME.......</p>            <button>CLICK ME</button>        </body>                   </html>


ARRAY An array stores multiple values in one single variable: <!DOCTYPE html> <html> <body> <?php $cars=array("Volvo","BMW","Toyota");  echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . "."; ?> </body> </html> In PHP, there are three types of arrays: Indexed arrays  - Arrays with numeric index Associative arrays  - Arrays with named keys Multidimensional arrays  - Arrays containing one or more arrays PHP Indexed Arrays There are two ways to create indexed arrays: The index can be assigned automatically (index always starts at 0): <!DOCTYPE html> <html> <body> <?php $cars=array("Volvo","BMW","Toyota");  echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . "."; ?> </body> </html> Get The Length of an Array -

PHP functions

PHP User Defined Functions Create a User Defined Function in PHP A user defined function declaration starts with the word "function": <!DOCTYPE html> <html> <body> <?php function writeMsg() {    echo "Hello world!"; } writeMsg(); ?> </body> </html> PHP Function Arguments <!DOCTYPE html> <html> <body> <?php function familyName($fname) {    echo "$fname Refsnes.<br>"; } familyName("Jani"); familyName("Hege"); familyName("Stale"); familyName("Kai Jim"); familyName("Borge"); ?> </body> </html> ==================================================================== <!DOCTYPE html> <html> <body> <?php function familyName($fname,$year) {    echo "$fname Refsnes. Born in $year <br>"; } familyName("Hege","1975"); familyName("Stale","1978&qu