Page 1 :
PHP – 2 Marks Question, 1. Explain any 4 features of PHP., -, , Simple : PHP is very simple and easy to use than other scripting languages, Interpreted: PHP is interpreted language to no need of compilation., Faster : PHP is faster scripting language than JSP and ASP languages, Platform Independent: PHP is Platform independent so execute over any operating system. Ex., Windows, Linux, Mac, UNIX etc., , 2. Explain Rules to declare variables in PHP., -, , Variable name start with $ sign followed by variable name, Variable name must start with alphabet or underscore sign (_), Variable name should combination of alphabet, digit and underscore sign, Variable name do not start with number, Variable name are case sensitive. ($a & $A are different variable), , 3. List the supported data types in PHP ., - Integer : integer data type is used to store non-decimal numeric value ex. 1,15, - Float : Float data type is used to store floating point values ex. 1.2 ,0.7, - String : String data type is used to store group of characters ex. “technology”, - Boolean : Boolean data type represent only two values 0 & 1, - Null : null is special data types which store only one value i.e. NULL, , 4. Explain comments in PHP., -, , -, , Comment is part of program that did not shown in output or executes., Comment used to add explanation about code., 1. Single line comment, // or # is used to add single line comment., For Ex. echo”Information” // echo display information on webpage, 2. Multiline comment, /*, */ is used to add multiline comments, , -, , For ex. echo”technology” /* echo will display technology on webpage */, , -, , 5. Explain any 4 string manipulation functions., -, , Strlen(), :- strlen() function returns length of character i.e. Number of characters, Strtolower() :- strtolower() converts string to lowercase characters, Strtoupper() : - strtoupper() converts string to uppercase characters, Str_replace() : - str_replace() replace some text of string by another string .