PHP Interview Cracks-By Students



I got job in PHP recently ,so I'm sharing my experience in cracking PHP Interviews








#Why PHP is referred as server scripting language?


PHP uses scripting language like HTML, JavaScript code etc & all this scripting language are compulsorily


executed at server end so its referred as server scripting language






#Whats syntax of PHP



The syntax of PHP is as below

<?php
?>






#Whats default file extension of PHP


The default file extension of PHP is .php




#Whats invalid in below code?


<?php


$x=5;

y=6;

$z=$x+$y;

echo $z;

?>

Variable y has no $ before it so correct php code is as below

<?php
$x=5;
$y=6;
$z=$x+$y;
echo $z;
?>



#Give way to do concatenation of two string variables together:


In Below example I had done concatenation of two string variables A,B with the help of Concatenation operator (.)

<?php

$A="Hello world!";

$B="What a nice day!";

echo $A . " " . $B;

?>








#Whats GET & POST in PHP?


Both  GET & POST Method attribute in PHP is used to order the browser how the form information should be sent. 

Below is syntax for GET Method

<FORM NAME ="form1" METHOD ="GET" ACTION = "">


Below is syntax for POST Method



<FORM NAME ="form1" METHOD =" POST" ACTION = "">






#Whats GET methods disadvantage?


When GET Method attribute in PHP is used it order the browser to send information ,but sensitive information like password in php form is easily seen in browser url so  GET methods is insecure








GET & POST in PHP are methods to














#Whats














#Whats














#Whats


















#Whats














#Whats






















No comments:

Post a Comment