php : Interview Questions

Answer:

PHP is a web language based on scripts that allows developers to dynamically create generated web pages. 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

Answer:

PHP means PHP: Hypertext Preprocessor

Answer: PHP syntax resembles Perl and C
Answer: PEAR means “PHP Extension and Application Repository”. it extends PHP and provides a higher level of programming for web developers.
Answer: :Software in which the source codes are freely used, modify, and shared by anyone are called Open Source Software. These can also be distributed under licenses that adhere with the Open Source Definition.
Answer: The include() statement includes and evaluates a specified line i.e. it will include a file based in the given path. require() does the same thing expect upon failure it will generate a fatal error and halt the script whereas include() will just gives a warning and allowscript to continue. require_once() will check if the file already has been included and if so it will not include the file again.
Answer: GET and POST are used to send information from client browser to web server. In case of GET the information is send via GET method in name/value pair and is URL encoded. The default GET has a limit of 512 characters. The POST method transfers the information via HTTP Headers. The POST method does not have any restriction in data size to be sent. POST is used for sending data securely and ASCII and binary type’s data. The $_REQUESTcontains the content of both $_GET, $_POST and $_COOKIE.
Answer: There are 4 basically types of error.
Parse Error – Commonly caused due to syntax mistakes in codes e.g. missing semicolon, mismatch brackets.

Fatal Error – These are basically run time errors which are caused when you try to access what can’t be done. E.g. accessing a dead object, or trying to use a function that hasn’t been declared.

Warning Error – These occurs when u try to include a file that is not present, or delete a file that is not on the server. This will not halt the script; it will give the notice and continue with the next line of the script.

Notice Error – These errors occurs when u try to use a variable that hasn’t been declared, this will not halt the script, It will give the notice and continue with the next line of the script.
Answer: Session is a super global variable that preserve data across subsequent pages. Session uniquely defines each user with a session ID, so it helps making customized web application where user tracking is needed.
Answer: Cookie is a small piece of information stored in client browser. It is a technique used to identify a user using the information stored in their browser (if already visited that website) . Using PHP we can both set and get COOKIE.
Answer: There are two methods through which we can know the total number ofelements:
sizeof($array_var)
count($array_var)
Answer: Split function splits string into array by regular expression. Explode splits a string into array by string.
Answer: The trim() function removes whitespaces or other predefined charactersfrom both sides of a string.
Answer: index.php is the default name of the home page in php based sites.
Answer: strlen() function used to find the length of a string.
Answer: This function is used to determine if a variable is set and is not NULL.
Answer: It is used for sort an array by key in reverse order
Answer: Unlink() deletes the given file from the file system
Answer: PEAR(PHP Extension and Application Repository) is a framework and repository for reusable PHP components. PEAR is a code repository containing allkinds of php code snippets and libraries.
PEAR also offers a command-line interface that can be used to automatically install "packages". $message vs. $$message in PHP.
$message is a variable with a fixed name. $$message is a variable whose name is stored in $message.
If $message contains "var", $$message is the same as $var.Echo vs. print statement.
PHP INTERVIEW QUESTIONS 4echo() and print() are language constructs in PHP, both are used to output strings. The speed of both statements is almost the same.
echo() can take multiple expressions whereas print cannot take multiple expressions.
Print return true or false based on success or failure whereas echo doesn't return true or false.
 
Answer: We can achieve the above task by using JavaScript code linked to an event trigger of any form field and call the document.form.submit() function in JavaScript code.Explain the different types of errors in PHP.
Notices, Warnings and Fatal errors are the types of errors in PHP
Notices: Notices represents non-critical errors, i.e. accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all but whenever required, you can change this default behavior.
Warnings: Warnings are more serious errors but they do not result in script termination. i.e calling include() a file which does not exist. By default, these errors are displayed to the user.
Fatal errors: Fatal errors are critical errors i.e. calling a non-existent function or class. These errors cause the immediate termination of the script.
Answer: PEAR is known as PHP Extension and Application Repository. It provides structured library to the PHP users and also gives provision for package maintenance.
Answer: The difference lies with the execution of the languages. PHP is server side scripting language, which means that it can’t interact directly with the user. Whereas, JavaScript is client side scripting language, that is used to interact directly with the user.
Answer: The main difference between $message and $$message is that former one is a simple variable and later is a reference variable. $message is a variable with a fixed name and it consists of a fixed value. $$messages contains the variable itself.
Answer: It is used to print a data in the webpage, Example: <?php echo 'Car insurance'; ?> , The following code print the text in the webpage
Answer: We can include a file using "include() " or "require()" function with file path as its parameter.
Answer: If the file is not found by require(), it will cause a fatal error and halt theexecution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
Answer: require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include thefile more times and you will not get the "function re-declared" error.
Answer: We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method .
Answer: Eg : var $arr = array('apple', 'grape', 'lemon');
Answer: This is not actually a real function, It is a language construct. So you can use with out parentheses with its argument list.
Example print('PHP Interview questions');
print 'Job Interview ');
Answer: in_array used to checks if a value exists in an arraY
Answer: count() is used to count all elements in an array, or something in an object
Answer: It’s how they handle failures. If the file is not found by require(), it will cause a fatalerror and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
Answer: The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user’s computers in the text fileformat. Cookies can not hold multiple variables,But Session can hold multiple variables.We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking
Answer: Setcookie("sample", "ram", time()+3600);
Answer: eg : echo $_COOKIE["user"];
Answer: Create session : session_start();
Set value into session : $_SESSION['USER_ID']=1;
Remove data from a session : unset($_SESSION['USER_ID'];
Answer: Yes variable name casesensitive and we can’t start a variable with number like $4name as A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
where as $$ is variable of variable $name is variable where as $$name is variable of variable
like $name=sonia and $$name=singh so $sonia value is singh.
Answer: We can connect Mysql Database with PHP using both Procedural and Object oriented style like below
$link = mysqli_connect(“localhost”, “username”, “password”, “dbofpcds”);
$mysqli = new mysqli(“localhost”, “username”, “password”, “dbname”);
and in old type of connectivity were
$link = mysql_connect(“localhost”, “username”, “password”);
mysql_select_db(“database”,$link);
Answer: we can retrieve the data in the result set of MySQL using PHP in 4 Ways
1. mysqli_fetch_row >> Get a result row as an enumerated array
2. mysqli_fetch_array >> Fetch a result row as associative and numeric array
3.mysqli_fetch_object >> Returns the current row of a result set as an object
4. mysqli_fetch_assoc >> Fetch a result row as an associative array
mysqli_fetch_object() is similar to mysqli_fetch_array(), with one difference -an object is returned, instead of an array. Indirectly, that means thatwe can only access the data by the field names, and not by theiroffsets (numbers are illegal property names).
Answer: There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for request PHP INTERVIEW QUESTIONS 8But in POST method unlimited data can we send
2. when we use GET method requested data show in url butNot in POST method so POST method is good for send sensetive request
Answer: preg_match(“/^http:\/\/.+@(.+)$/”,”http://info@tut2learn.com”,$matches);
echo $matches[1];
Answer: We can create MySQL database with the use ofmysql_create_db(“Database Name”)
Answer: Both include and require used to include a file but when included file not found
Include send Warning where as Require send Fatal Error .
Answer: Yes we can use include(“xyz.php”) more than one time in any page. but it create a prob when xyz.php file contain some funtions declaration then error will come for already declared function in this file else not a prob like if you want to show same content two time in page then must incude it two time not a prob
Answer: Following tables (Storage Engine) we can create
1. MyISAM(The default storage engine IN MYSQL Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format.The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension. )
2. InnoDB(InnoDB is a transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data.)
3. Merge
4. Heap (MEMORY)(The MEMORY storage engine creates tables with contents that are stored in memory. Formerly, these were known as HEAP tables.
MEMORY is the preferred term, although HEAP remains supported for backward compatibility. )
5. BDB (BerkeleyDB)(Sleepycat Software has provided MySQL with the Berkeley DB transactional storage engine. This storage engine typically is called BDB for short. BDB tables may have a greater chance of surviving crashes and are also capable of COMMIT and ROLLBACK operations on transactions)
6. EXAMPLE
7. FEDERATED (It is a storage engine that accesses data in tables of remote databases rather than in local tables. )
8. ARCHIVE (The ARCHIVE storage engine is used for storing large amounts of data without indexes in a very small footprint. )
9. CSV (The CSV storage engine stores data in text files using comma-separated values format.)
10. BLACKHOLE (The BLACKHOLE storage engine acts as a “black hole” that accepts data but throws it away and does not store it. Retrievals always return an empty result)
Answer: The header() function sends a raw HTTP header to a client.We can use herder()
function for redirection of pages. It is important to notice that header() mustbe called before any actual output is seen..
Answer: Just run the PHP CLI (Command Line Interface) program andprovide the PHP script file name as the command line argument.
Answer: In php.ini file:
setshort_open_tag=onto
make PHP support
Answer: Nothing more we have to do only redirect to the payPal url after submit all information needed by paypal like amount,adresss etc.
Answer: Inserts HTML line breaks (<BR />) before all newlines in a string.
Answer: .htaccess files are configuration files of Apache Server which providea way to make configuration changes on a per-directory basis. A file,containing one or more configuration directives, is placed in a particulardocument directory, and the directives apply to that directory, and allsubdirectories thereof.
Answer: By using $_SERVER['REMOTE_ADDR'],$_SERVER['HTTP_REFERER'] etc.
Answer: All of those are open source resource. Security of Linux is veryvery more than windows. Apache is a better server that IIS both infunctionality and security. MySQL is world most popular open sourcedatabase. PHP is more faster that asp or any other scripting language.
Answer: AES_ENCRYPT () and AES_DECRYPT ()
Answer: The functions in this section perform encryption and decryption, andcompression and uncompression:
Answer: To know the Image type use exif_imagetype () function
To know the Image size use getimagesize () function
To know the image width use imagesx () function
To know the image height use imagesy() function
Answer: By using
$_SERVER[’HTTP_USER_AGENT’] variable.
Answer: By default the maximum size is 2MB. and we can change the following setup at php.iniupload_max_filesize = 2M
Answer: by changing the following setup at php.inimax_execution_time = 30; Maximum execution time of each script, in seconds
Answer: To backup: BACKUP TABLE tbl_name[,tbl_name...] TO ‘/path/to/backup/directory’
RESTORE TABLE tbl_name[,tbl_name...] FROM
‘/path/to/backup/directory’mysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table. -t, –no-create-info Don’t write table creation information (the CREATE TABLE statement). -d, –no-data Don’t write any row information for the table. This is very useful if you just want to get a dump of the structure for a table.
Answer: • First of all instead of using select * from table1, use select column1, column2, column3.. from table1
•Look for the opportunity to introduce index in the table you are querying.
•use limit keyword if you are looking for any specific number of rows from the result set.
Answer: session_id() returns the session id for the current session.
Answer: session_unregister — Unregister a global variable from the current session
session_unset — Free all session variable
Answer: Set the cookie in past.
Answer: •GET/QueryString
•POST
Answer: eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.
Answer: Sort(), arsort(),
asort(), ksort(),
natsort(), natcasesort(),
rsort(), usort(),
array_multisort(),
anduksort().
Answer: 2 ways
a) sizeof($urarray) This function is an alias of count()
b) count($urarray)
Answer: Though i am not sure if this is wrong or not, With the exif extension you are able to work with image meta data.
Answer: bool is_numeric ( mixed var) Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number.
Answer: Case Studio
Smart Draw
Answer: WeWe can always fetch from one database and rewrite to another. Here is a nice solution of it.
$db1 = mysql_connect(”host”,”user”,”pwd”);
mysql_select_db(”db1?, $db1);
$res1 = mysql_query(”query”,$db1);
$db2 = mysql_connect(”host”,”user”,”pwd”);
mysql_select_db(”db2?, $db2);
$res2 = mysql_query(”query”,$db2);
At this point you can only fetch records from you previous ResultSet, i.e $res1 – But you cannot execute new query in $db1, even if yousupply the link as because the link was overwritten by the new db.so at this point the following script will fail
$res3 = mysql_query(”query”,$db1); //this will failSo how to solve that? take a look below.
$db1 = mysql_connect(”host”,”user”,”pwd”);
mysql_select_db(”db1?, $db1);
$res1 = mysql_query(”query”,$db1);
$db2 = mysql_connect(”host”,”user”,”pwd”, true);
mysql_select_db(”db2?, $db2);$res2 = mysql_query(”query”,$db2);
So mysql_connect has another optional boolean parameter whichindicates whether a link will be created or not. As we connect to the $db2 with this optionalparameter set to ‘true’, so both link willremain live. Now the following query willexecute successfully.
$res3 = mysql_query(”query”,$db1);
Answer: Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter
Answer: You can maintain two separate language file for each of the language. All the labels are putted in both language files as variables and assign those variables in the PHP source. On run-time choose the required language option.
Answer: Abstract class: abstract classes are the class where one or moremethods are abstract but not necessarily all method has to be abstract.
Abstract methods are the methods, which are declare in its class but not defined. The definition of those methods must be in its extending class.
Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be defined by its implemented class.
Answer: JavaScript does not have any networking capabilities as it isdesigned to work on client site. As a result we can not send mails usingJavaScript. But we cancall the client side mail protocol mailtovia JavaScript to prompt for an Email to send. this requires the client to approve it.
Answer: The syntex for repairing a MySQL table is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended].This command will repair the table specified if the quick is given the MySQL will do a repair of only the index tree if the extended is givenit will create index row by row.
Answer: A stored procedure is a set of SQL commands that can be compiled andstored in the server. Once this has been done, clients don’t need tokeep re-issuing the entire query but can refer to the stored procedure.This provides better overall performance because the query has to beparsed only once, and less information needs to be sent between theserver and the client. You can also raise the conceptual level by havinglibraries of functions in the server. However, stored procedures ofcourse do increase the load on the database server system, as more of the work is done on the server side and less on the client
(application)side.Triggers will also be implemented. A trigger is effectively a type PHP INTERVIEW QUESTIONS 15of stored procedure, one that is invoked when a particular event occurs.For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly.Withoutan index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the tablehas an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.
Answer: The following table describes the maximum length for each type of identifier.
There are some restrictions on the characters that may appear in identifiers.
Answer: MySQL set can take zero or more values but at the maximum it can take 64 values.
Answer: describe Table-Name;
Answer: The ‘.frm’ file stores the table definition.The data file has a ‘.MYD’ (MYData) extension.The index file has a ‘.MYI’ (MYIndex) extension.
Answer: In MySql, the default table type is MyISAM.Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.The ‘.frm’ file stores the table definition.The data file has a ‘.MYD’ (MYData) extension.The index file has a ‘.MYI’ (MYIndex) extension.
Answer: The two most common ways to start and finish a PHP script are: <?php[ — PHP code—- ] ?> and <? [— PHP code —] ?>
Answer: To be able to display the output directly to the browser, we have to use the special tags <?= and ?>.
Answer: PHP 5 presents many additional OOP (Object Oriented Programming) features.
Answer: PHP includes only single inheritance, it means that a class can be extended from only one single class using the keyword ‘extended’.
Answer: ‘final’ is introduced in PHP5. Final class means that this class cannot beextended and a final method cannot be overrided.
Answer: We use the operator ‘==’ to test is two object are instanced from the same class and have same attributes and equal values. We can test if two object are refering to the same instance of the same class by the use of the identity operator ‘===’.
Answer: It is possible to generate HTML through PHP scripts, and it is possible to pass informations from HTML to PHP.
Answer: If we would like to pass values througn a form or an URL then we need to encode and to decode them using htmlspecialchars() and urlencode().
Answer: PHP and Javascript cannot directly interacts since PHP is a server side language and Javascript is a client side language. However we can exchange PHP INTERVIEW QUESTIONS 17variables since PHP is able to generate Javascript code to be executed by the browser and it is possible to pass specific variables back to PHP via the URL.
Answer: GD library is needed to be able execute image functions.
Answer: imagetypes() gives the image format and types supported by the currentversion of GD-PHP.
Answer: The functions are getimagesize() for size, imagesx() for width and imagesy() for height.
Answer: If the function require() cannot access to the file then it ends with a fatalerror. However, the include() function gives a warning and the PHP script continues to execute.
Answer: require() and require_once() perform the same task except that the second function checks if the PHP script is already included or not before executing it.
(same for include_once() and include())
·version when you go in for your interview)·
MySQL- 5.5.23
Answer: Rasmus Lerdorf is known as the father of PHP.PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 andis a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend engine under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additional OOPs features.
Answer: The main idea behind this is to use Javascript submit() function in order to submit the form without explicitly clicking any submit button. You can attach the document.formname.submit() method to onclick, onchange events of different inputs and perform the form submission. youcan even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites).
Answer: You can do it by 4 Ways
1. mysql_fetch_row.
2. mysql_fetch_array
3. mysql_fetch_object
4. mysql_fetch_assoc
Answer: preg_match(”/^http://invalid.invalid/@(.+)
$/”,’raghav.cool@hotmail.com’,$found);
echo $found[1];
Answer: We can create MySQL Database with the use of mysql_create_db(“Database Name”).
Answer: Yes we can use include() more than one time in any page though it is nota very good practice.
Answer: URLencode returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW
formis encoded, that is the same way as in application/x-www-form-urlencoded media type. urldecode decodes any %## encoding in the given string.
Answer: unlink() deletes the given file from the file system.unset() makes a variable undefined.
Answer: URLencode returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW
formis encoded, that is the same way as in application/x-www-form-urlencoded media type. urldecode decodes any %## encoding in the given string.
Answer: unlink() deletes the given file from the file system.
unset() makes a variable undefined.
Answer: $_SESSION[’name’] = “RAGHAV”;
Answer: By using
$_SERVER[’HTTP_USER_AGENT’] variable.
Answer: Some interesting things, you can do in PHP. Also, there are a lot of hidden features like you can create .png image for games, create a .pdf files, GTK applications and much more.
Answer: 1.Laravel
2.CodeIgniter
3.Symfony
4.Phalcon
Answer: Here, if the value is non-zero, then if($var==’value’) is true and it will execute. If you put the value on the left, then it throws the PHP parse time error.
Answer: exit() function which stops the current php script (Execution of the page).
We included the
Answer: CAPTCHAis the short form of Completely Automated Public Turing Test. It?s a step taken to ensure that a feature is not abused in a way it?s not meant to beused. We use CAPTCHAS for general form submissions, registrations, user generated content and so on to prevent spam bots from clogging up the system or spamming.
Answer: GET function is normally used when the result of using this function does notcause any visible change on the state of the world. This is normally used in cases like searching from a database where no changes are made to the system.

POST function is used when there is a visible change on thestate of the world. When we use a POST function, normally the system changes. E.g. when we add, delete or modify values from a database. A simple example is a form submission.
 
Answer: Yes. We can use the get_browser() function to get the details of the browser auser is using. This information is usually found inside the browscap.ini file.
Answer: Yes. We can create a database using the function mysql_create_db(“<Insert database name here>”).
Answer: We can use include function multiple times in any dynamically generated PHP page. However, it?s not considered a good practice to have multiple include functions on the same page.
Answer: In PHP, everything is usually passed by value and not by reference.
Answer: There are two different ways to combine variables in PHP. Let?s take an example.
·$var1 = „Hello „;
·$var2 = „World?;
We can combine it using the two codes below
·$var 3 = $var1.$var2; and
·$var3 = “$var1$var2??;
It?s usually seen that, for large datasets, the first method outperforms the second one.

 
Answer: The current versions are
·PHP – 5.4.1 (As of this writing. Make sure you know the current
Answer: Rasmus Lerdorf is known as the father of PHP that started developmentof PHP in 1994
for their own Personal Home Page (PHP) and they released PHP/FI (Forms Interpreter) version 1.0 publicly on 8 June 1995 But in 1997 two Israeli developers named Zeev Suraski and Andi Gutmans rewrote the parser that formedthe base of PHP 3 and then changed the language’s name to the PHP: Hypertext Preprocessor.
Answer: The current stable version of PHP is PHP 5.4.5 as still waiting for PHP6with unicode handlig thing
There are lot of difference among PHP3 and PHP4 and PHP5 version of php so Difference mean oldest version have less functionality as compare to new one like
1>PHP3 is oldest stable version and it was pure procedural language constructive like C
2>Where as PHP4 have some OOPs concept added like class and object with new functionality
3>and in PHP5 approximately all major oops functionality has been added along with below thing
1. Implementation of exceptions and exception handling
2. Type hinting which allows you to force the type of a specific argument
3. Overloading of methods through the __call function
4. Full constructors and destructors etc through a __constuctor and __destructor function
5. __autoload function for dynamically including certain include files depending on the class you are trying to create.
6 Finality : can now use the final keyword to indicate that a method cannot be overridden by a child. You can also declare an entire class as final which prevents it from having any children at all.
7 Interfaces & Abstract Classes
8 Passed by Reference :
9 An __clone method if you really want to duplicate an object
10 Numbers of Functions Deprecated or removed in PHP 5.x like ereg,ereg_replace,magic_quotes, session_register,register_globals, split(), call_user_method() etc
 
Answer: Yes variable name casesensitive and we can’t start a variable with number like $4name as A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
where as $$ is variable of variable $name is variable where as $$name is variable of variable
like $name=sonia and $$name=singh so $sonia value is singh.
Answer: We can connect Mysql Database with PHP using both Procedural and Object oriented style like below
$link = mysqli_connect(“localhost”, “username”, “password”, “dbofpcds”);
$mysqli = new mysqli(“localhost”, “username”, “password”, “dbname”);
and in old type of connectivity were
$link = mysql_connect(“localhost”, “username”, “password”);
mysql_select_db(“database”,$link);
Answer: we can retrieve the data in the result set of MySQL using PHP in 4 Ways
1. mysqli_fetch_row >> Get a result row as an enumerated array
2. mysqli_fetch_array >> Fetch a result row as associative and numeric array
3.mysqli_fetch_object >> Returns the current row of a result set as an object
4. mysqli_fetch_assoc >> Fetch a result row as an associative array
mysqli_fetch_object() is similar to mysqli_fetch_array(), with one difference -an object is returned, instead of an array. Indirectly, that means thatwe can only access the data by the field names, and not by theiroffsets (numbers are illegal property names)
Answer: There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for requestBut in POST method unlimited data can we send
2. when we use GET method requested data show in url butNot in POST method so POST method is good for send sensetive request
 
Answer: preg_match(“/^http:\/\/.+@(.+)$/”,”http://info@tut2learn.com”,$matches);
echo $matches[1];
Answer: We can create MySQL database with the use ofmysql_create_db(“Database Name”)
Answer: Both include and require used to include a file but when included file not foundInclude send Warning where as Require send Fatal Error .
Answer: Yes we can use include(“xyz.php”) more than one time in any page. but it create a prob when xyz.php file contain some funtions declaration then error will come for already declared function in this file else not a prob like if you want to show same content two time in page then must incude it two time not a prob
Answer: Following tables (Storage Engine) we can create
1. MyISAM(The default storage engine IN MYSQL Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format.The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension. )
2. InnoDB(InnoDB is a transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data.)
3. Merge
4. Heap (MEMORY)(The MEMORY storage engine creates tables with contents that are stored in memory. Formerly, these were known as HEAP tables. MEMORY is the preferred term, although HEAP remains supported for backward compatibility. )
5. BDB (BerkeleyDB)(Sleepycat Software has provided MySQL with the Berkeley DB transactional storage engine. This storage engine typically is called BDB for short. BDB tables may have a greater chance of surviving crashes and are also capable of COMMIT and ROLLBACK operations on transactions)
6. EXAMPLE
7. FEDERATED (It is a storage engine that accesses data in tables of remote databases rather than in local tables. )
8. ARCHIVE (The ARCHIVE storage engine is used for storing large amounts of data without indexes in a very small footprint. )
9. CSV (The CSV storage engine stores data in text files using comma-separated values format.)
10. BLACKHOLE (The BLACKHOLE storage engine acts as a “black hole” that accepts data but throws it away and does not store it. Retrievals always return an empty result)
Answer: The header() function sends a raw HTTP header to a client.We can use herder()
function for redirection of pages. It is important to notice that header() mustbe called before any actual output is seen..
Answer: Just run the PHP CLI (Command Line Interface) program andprovide the PHP script file name as the command line argument.
Answer: In php.ini file:
set
short_open_tag=on
to make PHP support
Answer: Nothing more we have to do only redirect to the payPal url after submit all information needed by paypal like amount,adresss etc
Answer: Inserts HTML line breaks (<BR />) before all newlines in a string.
Answer: .htaccess files are configuration files of Apache Server which providea way to make configuration changes on a per-directory basis. A file,containing one or more configuration directives, is placed in a particulardocument directory, and the directives apply to that directory, and allsubdirectories thereof.
Answer: By using $_SERVER['REMOTE_ADDR'],
$_SERVER['HTTP_REFERER'] etc.
Answer: All of those are open source resource. Security of Linux is veryvery more than windows. Apache is a better server that IIS both infunctionality and security. MySQL is world most popular open sourcedatabase. PHP is more faster that asp or any other scripting language.
Answer: AES_ENCRYPT () and AES_DECRYPT ()
Answer: To be able to display a human-readable result we use print_r().
Answer: The set_time_limit(0) added at the beginning of a script sets to infinite the time of execution to not have the PHP error ‘maximum execution time exceeded’.It is also possible to specify this in the php.ini file.
Answer: This is a PHP syntax error expressing that a mistake at the line x stops parsing and executing the program.
Answer: The most common and used way is to get data into a format supported by Excel. For example, it is possible to write a .csv file, to choose for example comma as separator between fields and then to open the file with Excel.
Answer: file_get_contents() lets reading a file and storing it in a string variable.
Answer: To be able to connect to a MySQL database, we must use mysql_connect() function as follows:
Answer: mysql_pconnect() ensure a persistent connection to the database, it means that the connection do not close when the the PHP script ends.
Answer: The result set can be handled using mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object or mysql_fetch_row.
Answer: The function mysql_num_rows() returns the number of rows in a resultset.
Answer: mysql_affected_rows() return the number of entries affected by an SQLquery.
Answer: The mysql_fetch_object() function collects the first single matching record where mysql_fetch_array() collects all matching records from the table in an array.
Answer: In order to access the data sent via the GET method, we you use $_GET array like this:
www.url.com?var=value$variable = $_GET[“var”];
this will now contain ‘value’
Answer: To access the data sent this way, you use the $_POST array.Imagine you have a form field called ‘var’ on the form, when the user clicks submit to the post form, you can then access the value like this:
$_POST[“var”];
Answer: It is possible to use the dedicated function, is_numeric() to check whether it is a number or not.
Answer: It is possible to use the dedicated function, ctype_alnum to check whether it is an alphanumeric value or not.
Answer: If we want to check whether a variable has a value or not, it is possible to use the empty() function.
Answer: The unlink() function is dedicated for file system handling. It simply deletes the file given as entry.
Answer: The unset() function is dedicated for variable management. It will make a variable undefined.
Answer: addslashes function enables us to escape data before storage into the database.
Answer: The strips lashes function enables us to remove the escape characters before apostrophes in a string.
Answer: We have to enable the Magic quotes entry in the configuration file of PHP.
Answer: The function get_magic_quotes_gpc() tells us whether the magic quotesis switched on or no.
Answer: The strip_tags() function enables us to clean a string from the HTML tags.
Answer: A static variable is defined within a function only the first time and its value can be modified during function calls as follows:
Answer: array_combine give an array by combining two arrays($keyArray, $valueArray) and both $keyArray & $valueArray must have same number of elements. $keyArrays become keys of returning Array, $valueArray become values of  returning Arrays.
array_merge gives an array by merging two array ($array1, $array2) and both can have different number of elements. $array1 and $array2 are added in returning array.
Answer: Cookie are stored in client side (e.g Browser) where as Session are stored in server side (tmp file of web server). Cookie can be added/update/delete from browser but session can't delete from browser. Session is depended on cookie. For example: When user login in website then session is created in webserver.
Answer: CRYPT(), MD5()
Answer: move_uploaded_file( string filename, string destination)
Answer: The mysql_error() message will tell us what was wrong with our mysqlquery.
Answer: 1. A data member belongs to an object of a class whereas local variable belongs to its current scope. 2. A local variable is declared within the body of a function and can be used only from the point at which it is declared to the immediately following closing brace.
1. A data member belongs to an object of a class whereas local variable belongs to its current scope.
2. A local variable is declared within the body of a function and can be used only from the point at which it is declared to the immediately following closing brace.
3. Data members are accessible to all member function of the class. Local variableare not accessible in any another function or class.

2. The only rule is that static methods or properties are out of object context.
3. Public function of class can be access by scope resolution operator (i.e ::) and Object Reference Operator (i.e ->) but public data member can't be access through scope resolution operator.
Answer: Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. If it does not exist, it creates the link.
Persistent connections are good if the overhead to create a link to your SQL serveris high. Whether or not this overhead is really high depends on many factors. Like, what kind of database it is, whether or not it sits on the same computer on which your web server sits, how loaded the machine the SQL server sits on is and so forth. The bottom line is that if that connection overhead is high, persistent connections help you considerably.
Answer: Restart Apache web server over the SSH/etc/init.d/apache2 restart
Stop Apache web server over the SSH/etc/init.d/apache2 stop
Start Apache web server over the SSH/etc/init.d/apache2 start
httpd Server restart commandservice httpd restart
httpd Server Stop command
service httpd stop
httpd Server Stop commandservice httpd start
 
Answer: Full form ofORMis ObjectRelationMapper.
ORM is programming technique for converting data between incompatible type systems in object-oriented programming languages.
Data management tasks in object-oriented programming(OOP) are typically implemented by manipulating objects that are almost always non-scalar values.For example, consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses. This could be modeled in an object-oriented implementation by a "Person object" with attributes/fields to hold each data item that the entry comprises: the person's name,a list of phone numbers, and a list of addresses. The list of phone numbers would itself contain "PhoneNumber objects" and so on. The address book entry is treatedas a single object by the programming language (it can be referenced by a single variable containing a pointer to the object, for instance)
 
Answer: Exception Handling is used to handle the error. It can handle all types oferror like Warning, Notice, User defined Error message etc but unfortunately it can not handle fatal error.read more...
Answer: Dispatching is the process of taking the request object, Zend_Controller_Request_Abstract, extracting the module, controller, action name, and optional parameters contained in it, and then instantiating a controller and calling an action of that controller. If any of the module name, controller name, or action are not found, it will use default values for them.
Zend_Controller_Dispatcher_Standard specifies index for each of the controller and action defaults and default for the module default value, but allows the developer to change the default values for each using the setDefaultController(), setDefaultAction(), and setDefaultModule() methods, respectively.
Answer: In Zend Framework, bootstrapping is the process that loads your application. This includes, but is not limited to the Session. Any resources needed by your application to process the request (the dispatch) to the application is bootstrapped/loaded/initialized before the request is fulfilled, e.g. before the controller delegates any input to the model and creates a response that is send back to the client.
Answer: Following are the advantage / disadvantage of SP.
Advantage
You do not need to deploy to make a change.
Faster
Easier to expand a system

Disadvantages
Refactoring is harder. Renaming or changing where the store proc is might
produce a bad effect.
Unit testing stored proc require code assistance outside the DB

 
Answer: World Wide Web
The number(eg 1,2,3,4,5....) that follows the "WWW" indicates that the data beingretrieved by the Web browser is gathering the information from a different Web server than the one that serves the typical "WWW" address.
Web sites, especially dynamic Web sites, that handle large amounts of traffic oftenneed more than one server to accommodate the many requests they receive as one server often cannot handle the multitude of requests.
Examples

https://www1.pearsonvue.com/
https://www2.pearsonvue.com/
https://www3.pearsonvue.com/
https://www4.pearsonvue.com/
https://www5.pearsonvue.com/
https://www6.pearsonvue.com/
Here all above websites have same data.
Answer: New Relic is software as a service (SaaS) that monitors your Website and mobile applications(Android, iOS) in real-time that run in different environments like cloud, on-premise and hybrid.

Following are few benefits of New Relic
1. Monitoring your website regularly.
2. Downtime Notification by email.
3. Custom Error recording and then report you in email & also can view in newrelicwebsite.
4. Key Transaction tracking: You will be able to see where your application is spending most of its time (e.g. inthe controller, model OR database).
5. External Service Call Recording (Webservices)
Answer: Apdex means Application Performance Index.
It is standard method for reporting & comparing the performance of software.
Purpose: Analyse the performance, user satisfaction & expectation then Convert into percentage.
Formula
Apdex = (Satisfied + Tolerating / 2) / Total
Satisfied: Response time is less than or equal to T.
Tolerated: Response time is more than T and (Less than OR Equal to 4T);
Frustrated: Response time is greater than 4T.
T: It is threshold time define by application owner.
Example: https://docs.newrelic.com/docs/assets/apdex.pdf
 
Answer: Follow simple steps
1. login to command prompt (CMD)
2. Go to path where "php.exe" exist in wamp folder."C:\wamp\bin\php\phpx.x.x";
3. Execute the file with php, for examplephp c:/wamp/www/arun/test.php
Answer: URL coding converts special characters into % signs followed by two hex digits.
For example, urlencode("10.00%") will return "10.00%?urldocode is just opposite to urlencode
Answer: unlink: It unlink(remove) the file.
unset: It unlink(remove) the variable from scope.
Answer: type: exif_imagetype()
size: use getimagesize()
width: use imagesx()
height: use imagesy()
 
Answer: Function                Description
printf() :                   Displays a formatted strings
printf() :                   Saves a formatted string in a variable
fprintf() :                   Prints a formatted string to a file
number_format() :     Formats numbers as strings
Answer: mysql_connect(servername,username,password);
Answer: AES_ENCRYPT () and AES_DECRYPT ()





 
Answer: The functions in this section perform encryption and decryption, andcompression and uncompression:
Answer: One of the main advantages of OO programming is its ease of  modification; objects can easily be modified and added to a system there by reducing maintenance costs. OO programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an OO approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system.
Answer: Inserts HTML line breaks
(
)
before all newlines in a string string nl2br (string); Returns string with ” inserted before all newlines.
For example: echo nl2br(”god bless/n you”) will output “god blessyou” to your browser.
Answer: The Zend Engine is the internal compiler and runtime engine used by PHP4. Developed by Zeev Suraski and Andi Gutmans, the Zend Engine is anabbreviation of their names. In the early days of PHP4, it worked as follows: The












PHP script was loaded by the Zend Engine and compiled into Zend opcode. Opcodes, short for operation codes, are low level binary instructions. Then the opcode was executed and the HTML generated sent to the client. The opcode was flushed from memory afterexecution.Today, there are a multitudeof products and techniques to help you speed up this process. In the following

< /> < /> <>>< /> <>><> </>
Answer: Yes we can use include() more than one time in any page though it is not a very good practice.
Answer: Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
MyISAM is the default storage engine as of MySQL 3.23 and as a result ifwe do not specify the table name explicitly it will be assigned to the   default engine.
Answer: mysql_fetch_object() is similar to mysql_fetch_array(), with one difference –
an object is returned, instead of an array. Indirectly, that means that you can only access the data by the field names, and not by their offsets (numbers are illegal property names).
Answer: As of Aug 2008 the current versions are PHP: php5.2.6
MySQL: MySQL 5.1.2
Apache: Apache 2.2.9
Note: visit
http://www.php.net/,
http://dev.mysql.com/downloads/mysql/,
http://www.apache.org/ to get current
versions.

 
Answer: All of those are open source resource. Security of Linux is very very more than windows. Apache is a better server that IIS both in functionality and security. MySQL is world most popular open source database. PHP is more faster that asp or any other scripting language.
Answer: You can find these specific information in PHP Manual.
Answer: As of version 4.3.0, PHP supports a new SAPI type (Server Application Programming Interface) named CLI which means Command Line Interface. Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
 
Answer: We can create MySQL Database with the use of mysql_create_db(“Database Name”).
Answer: The include() statement includes and evaluates the specified file.The documentation below also applies to require(). The two constructs are identical inevery way except how they handle
failure. include() produces a Warning while require() results in a Fatal Error. In other words, use
require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. The include_once()statement includes and evaluates the
specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be
included again. As the name suggests, it will be included just once.include_once()should be used in cases where the same file might be included and evaluated morethan once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc. require_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function
redefinitions, variable value reassignments, etc
Answer: The main idea behind this is to use Javascript submit() function in order to submit the form without explicitly clicking any submit button. You can attach the document.formname.submit() method to onclick, onchange events of different inputs and perform the form submission. youcan even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites).
Answer: Here are three basic types of runtime errors in PHP:
o1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior.
o2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
o3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behavior is to display themto the user when they take place.
Answer: SQL injection is a malicious code injection technique.It exploiting SQLvulnerabilities in Web applications
Answer: Read/Write. Creates a new file. Returns FALSE and an error if file already exists
Answer: strpos() is used to find the position of the first occurrence of a substring in a string
Answer: PEAR is a framework and distribution system for reusable PHP components.The project seeks to provide a structured library of code, maintain a system for distributing code and for managing code packages, and promote a standard coding style.PEAR is broken into three classes: PEAR Core Components, PEAR Packages, and PECL Packages. The Core Components include the base classes of PEAR and PEAR_Error, along with database, HTTP, logging, and e-mailing functions. The PEAR Packages include functionality providing for authentication, networking, and file system features, as well as toolsfor working with XML and HTML templates.
Answer: This method is best when encode a string to used in a query part of a url. it returns a string in which all non-alphanumeric characters except -_. have replece with a percentege(%) sign . the urldecode->Decodes url to encode string as any %and other symbole are decode by the use of the urldecode() function.
Answer: In PHP, there are three types of runtime errors, they are:
Warnings: These are important errors. Example: When we try to include () file which is not available. These errors are showed to the user by default but they will not result inending the script.
Notices: These errors are non-critical and trivial errors that come across while executing the script in PHP. Example: trying to gain access the variable which is not defined. These errors are not showed to the users by default even if the default behavior is changed.
Fatal errors: These are critical errors. Example: instantiating an object of a class which does not exist or a non-existent function is called. These errors results in termination ofthe script immediately and default behavior of PHP is shown to them when they take place. Twelve different error types are used to represent these variations internally.
 
Answer: When to use GET or POST
The HTML 2.0 specification says, in section Form Submission (and the HTML 4.0 specification repeats this with minor stylistic changes):
–>If the processing of a form is idempotent (i.e. it has no lasting observable effecton the state of the
world), then the form method should be GET. Many database searches have no visible side-effects and make ideal applications of query forms.

–>If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.
Answer: quotation from the HTML 4.0 specification
–> If the method is “get” – -, the user agent takes the value of action, appends a ? to it, then appends the form data set, encoded using the application/x-www-form-urlencoded content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes.
–> If the method is “post” –, the user agent conducts an HTTP post transaction using the value of the action attribute and a message created according to the content type specified by the enctype  attribute.
Answer: Firstly, the the HTTP protocol specifies differing usages for the two methods. GET requests should always be idempotent on the server. This means that whereas one GET request might (rarely) change some state on the Server, twoor more identical requests will have no further effect.
This is a theoretical point which is also good advice in practice. If a user hits “reload” on his/her browser, an identical request will be sent to the server, potentially resulting in two identical database or guestbook entries, counter increments, etc. Browsers may reload a GET URL automatically, particularly if cacheing is disabled (as is usually the case with CGI output), but will typically prompt the user before re-submitting a POST request. This means you’re far less likely to get inadvertently-repeated entries from POST.
GET is (in theory) the preferred method for idempotent operations, such as querying a database, though it matters little if you’re using a form. There is a further practical constraint that many systems have built-in limits to the length of a GET request they can handle: when the total size of a request (URL+params) approaches or exceeds 1Kb, you are well-advised to use POST in anycase.
I would prefer POST when I don’t want the status to be change when user resubmits. And GET
when it does not matter.
Answer: In php.ini file:
set
short_open_tag=on
to make PHP support
Answer: We can find the detail documentation about different paypal integration process at the following site PayPal PHP
SDK : http://www.paypaldev.org/
Answer: preg_match(”/^http://.+@(.+)$/”,’raghav.cool@hotmail.com’,$found);echo $found[1];
Answer: It is a classic example of PHP’s variable variables. take the following example.
$message = “Raghav”;
$$message = “is a owner of https://sharag.wordpress.com/ “;
$message is a simple PHP variable that we are used to. But the $$message is not avery familiar face. It creates a variable name $mizan with the value “is a moderator of PHPXperts.” assigned. break it like this${$message} => $mizanSometimes it is convenient to be able to have variable variable names. That is, a variable name which can be set and used dynamically.
 
Answer: You can do it by 4 Ways
1. mysql_fetch_row.
2. mysql_fetch_array
3. mysql_fetch_object
4. mysql_fetch_assoc
 
Answer: Rasmus Lerdorf is known as the father of PHP.PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 andis a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend engine under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additional OOPs features.
Answer: mysql_select_db($db_name);
Answer: $my_qry = mysql_query("SELECT * FROM `users` WHERE `u_id`='1'; ");
$result = mysql_fetch_array($my_qry);
echo $result['First_name'];
 
Answer: $my_qry = mysql_query("SELECT * FROM `users` WHERE `u_id`='1'; ");
while($result = mysql_fetch_array($my_qry))
{
echo $result['First_name'.]."
";
}
Answer: 1. mysql_fetch_row
2. mysql_fetch_array
3. mysql_fetch_objec
4. mysql_fetch_assoc
Answer: Syntax : array explode ( string $delimiter , string $string [, int $limit ] );
This function breaks a string into an array. Each of the array elements is a substring of string formed by splitting it on boundaries formed by the string delimiter.
Answer: There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the databasenewconnection while using mysql_pconnect , the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection... the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use.
Answer: It is used to escapes special characters in a string for use in an SQL statement
Answer: if ($_FILES["file"]["error"] == 0)
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
Answer: $filename = "/home/user/guest/newfile.txt";
$file = fopen( $filename, "w" );
if( $file == false )
{
echo ( "Error in opening new file" ); exit();
}
fwrite( $file, "This is a simple test\n" );
fclose( $file );
Answer: oMysql_fetch_array Fetch a result row as an associative array, a numeric array, or both.
omysql_fetch_object ( resource result ) Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there areno more rows
omysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.
Answer: Unlink() deletes the given file from the file system.
Answer: It is used for sort an array by key in reverse order.
Answer: They are both variables. But $var is a variable with a fixed name. $$varis a variable who's name is stored in $var. For example, if $var contains "message", $$var is the same as $message.
Answer: Using define() directive, like define ("MYCONSTANT",150)
Answer: The enctype attribute determines how the form-data should be encodedwhen submitting it to the server. We need to set enctype as "multipart/form-data" when we are using a form for uploading files
Answer: We can create input fields with same name for "name" attribute with squire bracket at the end of the name of the name attribute, It passes data as an array to PHP.
For instance :
<input name="MyArray[]" /> <input name="MyArray[]" /> <input name="MyArray[]" /> <input name="MyArray[]" />
Answer: session_id() function returns the session id for the current session.
Answer: Html entities Convert all applicable characters to HTML entities This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
Answer: MD5 PHP implements the MD5 hash algorithm using the md5 function,
eg : $encrypted_text = md5 ($msg);
mcrypt_encrypt :- string mcrypt_encrypt ( string $cipher , string $key , string $data , string $mode [, string $iv ] );
Encrypts plaintext with given parameters
Answer: To send email using PHP, you use the mail() function.This mail() function accepts 5 parameters as follows (the last 2 are optional). You need webserver, you can't send email from localhost. eg : mail($to,$subject,$message,$headers);
Answer: The date() function provides you with a means of retrieving the currentdate and time, applying the format integer parameters indicated in your script to the timestamp provided or the current local time if no timestamp is given. In simplified terms, passing a time parameter is optional - if you don't, the current timestamp will be used.
Answer: Object orientation is a software/Web development methodology that is based on the modeling a real world system.An object is the core concept involved in the object orientation. An object is the copy of the real world enity.An object oriented model is a collection of objects and its inter-relationships
Answer: The trim() function removes whitespaces or other predefined characters from bothsides of a string.
Answer: The header() function sends a raw HTTP header to a client browser.Remember that this function must be called before sending the actual out put.For example, You do not print any HTML element before using this function.
Answer: The following code can be used for it,
header("Location:index.php");
Answer: exit() function is used to stop the execution of a page
Answer: index.php is the default name of the home page in php based sites
Answer: strlen() function used to find the length of a string
Answer: It is used to generate random numbers.If called without the arguments it returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 6 and 12 (inclusive), for example, use rand(6, 12).This function does not generate cryptographically safe values, and should not be used forcryptographic uses. If you want a cryptographically secure value, consider using openssl_random_pseudo_bytes() instead.
Answer: This function is used to determine if a variable is set and is not NULL
Answer: mysql_fetch_assoc function Fetch a result row as an associative array,
While mysql_fetch_array() fetches an associative array, a numeric array, or both
Answer: Associative arrays are arrays that use string keys is called associative arrays.
Answer: "method" attribute determines how to send the form-data into the server.There are two methods, get and post. The default method is get.This sends the form information by appending it on the URL.Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.
Answer: The action attribute determines where to send the form-data in the formsubmission.
Answer: Traditional programming has the following characteristics:Functions arewritten sequentially, so that a change in programming can affect any code that follows it. If a function is used multiple times in a system (i.e., a piece of code that manages the date), it is often simply cut and pasted into each program (i.e., a change log, order function, fulfillment system, etc). If a date change is needed (i.e., Y2K when the code needed to be changed to handle four numerical digits instead of two), all these pieces of code must be found, modified, and tested. Code(sequences of computer instructions) and data (information on which the instructions operates on) are kept separate. Multiple sets of code can access and modify one set of data. One set of code may rely on data in multiple places. Multiple sets of code and data are required to work together. Changes made to anyof the code sets and data sets can cause problems through out the system.Object-Oriented programming takes a radically different approach:Code and data are merged into one indivisible item – an object (the term “component” has also been used to describe an object.) An object is an abstraction of a set of real-world things (for example, an object may be created around “date”) The object would contain all information and
functionality for that thing (A date object it may contain labels like January, February, Tuesday, Wednesday.
It may contain functionality that manages leap years, determines if it is a business day or a holiday, etc., See Fig. 1). Ideally, information about a particular thing should reside in only one place in a system.The information within an object is encapsulated (or hidden) from the rest of the system. A system is composed of multiple objects (i.e., date function, reports, order processing, etc., See Fig 2). When one object needs information from another object, a request is sent asking for specific information. (for example, a report object may need to know what today’s date is and will send a request to the date object) These requests are called   messages and each object has an interface that manages messages. OO programming languages include features such as “class”, “instance”, “inheritance”, and “polymorphism” that increase the power andflexibility of an object.
Answer: Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class oras global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class which names them as a friend, as if they were themselvesmembers of that class. A friend declaration is essentially a prototype for a memberfunction, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match.
Answer: Public: Public declared items can be accessed everywhere.Protected: Protected limits access to inherited and parent classes (and to the class that defines the item).
Private: Private limits visibility only to the class that defines the item.
Static: A static variable exists only in a local function scope, but it does not lose its value when program execution leaves this scope.
Final: Final keyword prevents child classes from overriding a method by prefixing the definition with final. If the class itself is being defined final then it cannot be extended.
Transient: A transient variable is a variable that may not be serialized.
Volatile: a variable that might be concurrently modified by multiple threads should be declared volatile. Variables declared to be volatile will not be optimizedby the compiler because their value can change at any time.
Answer: Three are three types of errors:1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although, as you will see, you can change this default behavior.2. Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but  they do not result in script termination.3. Fatal errors: These are critical errors – for example,
instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.
Answer: strstr:
Returns part of haystack string from the first occurrence of needle to the end of haystack.If needle is not found, returns FALSE. If needle is not a string, it is converted to an integer and applied as the ordinal value of a character. This function is case-sensitive. For case-insensitive searches, use stristr().
Answer: PHP 3 is most procedure oriented and , PHP4 and PHP5 aer object oriented.
For more details http://php.net/
 
Answer: There are lots of tools available for asp to PHP conversion. you can search Google for that. the best one is available at http://asp2php.naken.cc/
Answer: Convert all applicable characters to HTML entitiesThis function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
Answer: $second = date(”s”);
Answer: By using date_default_timezone_get anddate_default_timezone_set function on PHP 5.1.0
<!–p// Discover what 8am in Tokyo relates to on the East Coast of the US
// Set the default timezone to Tokyo time:
date_default_timezone_set(’Asia/Tokyo’);
// Now generate the timestamp for that particular timezone, on Jan 1st, 2000
$stamp = mktime(8, 0, 0, 1, 1, 2000);
// Now set the timezone back to US/Eastern
date_default_timezone_set(’US/Eastern’);
// Output the date in a standard format (RFC1123), this will print:
// Fri, 31 Dec 1999 18:00:00 EST
echo ‘
‘, date(DATE_RFC1123, $stamp) ,’
‘; ?>
Answer: URLencode returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form
is encoded, that is the same way as in application/x-www-form-urlencoded media type. urldecode decodes any %## encoding in the given string.
Answer: unlink() deletes the given file from the file system.
unset() makes a variable undefine
Answer: $_SESSION[’name’] = “RAGHAV”;
Answer: If the operating system or file system places a limit on the number of files in a directory, MySQL is bound by thatconstraint.The efficiency of the operating system in handling large numbers offiles in a directory can place a practical limit on the number of tables in a database. If the time required to open afile in the directory increases significantly as the number of files increases, database performance can be adversely affected.The amount of available disk space limits the number of tables.MySQL3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to65536 terabytes (2567 – 1 bytes). With this larger allowed table size,the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits.The InnoDB storage engine maintains InnoDB tables within a table space  that can be created from several files. This allows a table to exceed the maximum individual file size. The table space can include raw disk partitions, which allows extremely large tables. The maximum table space size is 64TB.The following table lists some examples of operating system file-size limits. This is only a roughguide and is not intended to be definitive.For the most up-to-date information, be sure to check the documentationspecific to your operating system.Operating System File-size Limit Linux 2.2-Intel 32-bit 2GB (LFS: 4GB)
Linux 2.4+ (using ext3 filesystem) 4TB
Solaris 9/10 16TB
NetWare w/NSS filesystem 8TB
Win32 w/ FAT/FAT32 2GB/4GB
Win32 w/ NTFS 2TB (possibly larger)
MacOS X w/ HFS+ 2TB
Answer: The generic syntax for grant is as following :
> GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY[password]now rights can be a) All privileges b) combination of create, drop, select, insert, update and delete etc. We can grant rights on all databse by using *.* or some specificdatabase by database.* or a specific table by
database.table_name username@hotsname can be either username@localhost, username@hostname and username@% where hostname is any valid hostname and % represents any name, the *.*any condition password is simply the password of user.
The generic syntax for revoke is as following :
> REVOKE [rights] on [database/s] FROM [username@hostname] now rights can be as explained above a) All privileges b) combination of create, drop, select, insert, update and delete etc.username@hotsname can be either
username@localhost, username@hostname and username@% where hostname is any valid hostname and % represents any name, the *.*any condition
Answer: The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms,but the last two are mainly academic and will not be discussed).First Normal Form The First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic). Second Normal Form Where the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First NormalForm.Third Normal Form I have a confession to make; I do not often use Third Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependent on the primary key, but dependent on another value in the table.
Answer: Use this for mysql>SELECT COUNT(*) FROM table_name;
Answer: $result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo “$num_rows rows found”;
Answer: SELECT CURDATE();
CURRENT_DATE() = CURDATE()
for time use SELECT CURTIME();
CURRENT_TIME() = CURTIME()
Answer: External Style Sheets
Advantages : Can control styles for multiple documents at once. Classes can be created for use on multiple HTML element types in many documents.Selector andgrouping methods can be used to apply styles under complex contexts.
Disadvantages : An extra download is required to import style information for eachdocument The rendering of the document may be delayed until the externalstyle sheet is loaded becomes slightly unwieldy for small quantities ofstyle definitions.
Embedded Style Sheets
Advantages : Classes can be created for use on multiple tag types in the document.Selector and grouping methods can be used to apply styles under complexcontexts. No additional downloads necessary to receive style information.
Disadvantages : This method can not control styles for multiple documents at once.
Inline Styles
Advantages : Useful for small quantities of style definitions. Can override otherstyle specification methods at the local level so only exceptions needto be listed in conjunction with other style methods.
Disadvantages : Does not distance style information from content (a main goal ofSGML/HTML). Can not control styles for multiple documents at once.Author can not create or control classes of elements to control multipleelement types within the document. Selector grouping methods can not beused to create complex element addressing scenarios
 
Answer: In PHP an extended class is always dependent on a single base class,that is, multiple inheritance is supported by interfaces. Classes are extended using the keyword ‘extends’.
Answer: Primary Key: A column in a table whose values uniquely identify therows in the table. A primary key value cannot be NULL.
Unique Key: Unique Keys are used to uniquely identify each row in thetable. There can be one and only one row for each unique key value. So NULL can be a unique key.There can be only one primary key for a table but there can be morethan one unique for a table
Answer: Both of them are open source software (so free of cost), supportcross platform. php is faster then ASP and JSP.
Answer: ORDER BY [col1],[col2],...,[coln]; Tells DBMS according to what columns it should sort the result. If two rows will have the same value in col1it will try to sort them according to col2 and so on.GROUP BY[col1],[col2],...,[coln]; Tells DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average.
Answer: Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m bytes Set varchar to occupy n bytes and it will take only the requiredspace and will not use the n bytes eg. name char(15) will waste 10 bytes if we store ‘mizan’, if each char takes a byte eg. name varchar(15) will just use 5 bytes if we store ‘mizan’, if each char takes a byte. rest 10 bytes will be free.
Answer: Calculate the md5 hash of a string. The hash is a 32-characterhexadecimal number. I use it to generate keys which I use to identifyusers etc. If I add random no techniques to it the md5 generated nowwill be totally different for the same string I am using
Answer: you can use LOAD DATA INFILE file_name; syntax to load datafrom atext file. but you have to make sure thata) data is delimitedb) columns and data matched correctly.
Answer: SELECT DATEDIFF(’2007-03-07?,’2005-01-01?);
Answer: $date1 = date(’Y-m-d’);
$date2 = ‘2006-08-15?;
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
Answer: The functions in this section perform encryption and decryption, andcompression and uncompression:
< />  
Answer: One of the main advantages of OO programming is its ease ofmodification; objects can easily be modified and added to a system thereby reducing maintenance costs. OO programming is also considered to bebetter at modeling the real world than is procedural programming. Itallows for more complicated and flexible interactions. OO systems arealso easier for non-technical personnel to understand and easier forthem to participate in the maintenance and enhancement of a systembecause it appeals to natural human cognition patterns.
For some systems, an OO approach can speed development time since manyobjects are standard across systems and can be reused. Components thatmanage dates, shipping, shopping carts, etc. can be purchased and easily  modified for a specific system
Answer: There are lot of difference between procedure language and object oriented like below
1>Procedure language easy for new developer but complex to understand whole software as compare to object oriented model
2>In Procedure language it is difficult to use design pattern mvc , Singleton pattern etc but in OOP you we able to develop design pattern
3>IN OOP language we able to ree use code like Inheritance ,polymorphism etc but this type of thing not available in procedure language on that our Fonda use COPY and PASTE .
Answer: Sometimes a function is best shared among a number of differentclasses. Such functions can be declared either as member functions ofone class or as global functions. In either case they can be set to befriends of other classes, by using a friend specifier in the class thatis admitting them. Such functions can use all attributes of the classwhich names them as a friend, as if they were themselves members of thatclass.
A friend declaration is essentially a prototype for a member function,but instead of requiring an implementation with the name of that classattached by the double colon syntax, a global function or memberfunction of another class provides the match.
Answer: Public: Public declared items can be accessed everywhere.
Protected: Protected limits access to inherited and parentclasses (and to the class that defines the item).Private: Private limits visibility only to the class that definesthe item.
Static: A static variable exists only in a local function scope,but it does not lose its value when program execution leaves this scope.
Final: Final keyword prevents child classes from overriding amethod by prefixing the definition with final. If the class itself isbeing defined final then it cannot be extended.
transient: A transient variable is a variable that may notbe serialized.
volatile: a variable that might be concurrently modified by multiplethreads should be declared volatile. Variables declared to be volatilewill not be optimized by the compiler because their value can change atany time.
Answer: Three are three types of errors:
1. Notices: These are trivial,non-critical errors that PHP encounters while executing a script “ for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all “ although, as you will see, you can change this default behavior.
2. Warnings: These are more serious errors “ for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
3. Fatal errors: These are critical errors “ for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display themto the user when they take place.
Answer: strstr Returns part of string from the first occurrence of needle(sub string that we finding out ) to the end of string.
$email= ‘sonialouder@gmail.com’;
$domain = strstr($email, ‘@’);
echo $domain; // prints @gmail.com
here @ is the needle
stristr is case-insensitive means able not able to diffrenciate between a and A
Answer: Javascript submit() function is used for submit form without submit button on click call document.formname.submit()
Answer: There are lots of tools available for asp to PHP conversion. you can search Google for that. the best one is available athttp://asp2php.naken.cc./
Answer: Convert all applicable characters to HTML entitiesThis function is identical to htmlspecialchars() in all ways, exceptwith htmlentities(), all characters which have HTML character entityequivalents are translated into these entities.
Answer: $second = date(“s”);
Answer: By using date_default_timezone_get and
date_default_timezone_set function on PHP 5.1.0
<?php
// Discover what 8am in Tokyo relates to on the East Coast of the US
// Set the default timezone to Tokyo time:
date_default_timezone_set(‘Asia/Tokyo’);
// Now generate the timestamp for that particular timezone, on Jan 1st, 2000
$stamp = mktime(8, 0, 0, 1, 1, 2000);
// Now set the timezone back to US/Eastern
date_default_timezone_set(‘US/Eastern’);
// Output the date in a standard format (RFC1123), this will print:
// Fri, 31 Dec 1999 18:00:00 EST
echo ‘

’, date(DATE_RFC1123, $stamp) ,’

’;?>
Answer: URLencode returns a string in which all non-alphanumeric charactersexcept -_. have been replaced with a percent (%)
sign followed by two hex digits and spaces encoded as plus (+)
signs. It is encoded the same way that the posted data from a WWW form
is encoded, that is the same way as
inapplication/x-www-form-urlencoded media type.
urldecode decodes any %##
encoding in the given string.
 
Answer: unlink() deletes the given file from the file system.
unset() makes a variable undefined.
Answer: $_SESSION['name'] = “tut2learn”;
Answer: To know the Image type use exif_imagetype () function
To know the Image size use getimagesize () function
To know the image width use imagesx () function
To know the image height use imagesy() function
 
Answer: By using
$_SERVER['HTTP_USER_AGENT']
variable.
Answer: This  feature is possible using the global keyword.
Answer: A function returns a value using the instruction ‘return $value;’.
Answer: It is preferable to use crypt() which natively supports several hashing algorithms or the function hash() which supports more variants than crypt() rather than using the common hashing algorithms such as md5, sha1 or sha256 because they are conceived to be fast. hence, hashing passwords with these algorithms can vulnerability.
Answer: The PHP-openssl extension provides several cryptographic operations including generation and verification of digital signatures.
Answer: The define() directive lets us defining a constant as follows:define (“ACONSTANT”, 123);
Answer: To be able to pass a variable by reference, we use an ampersand in front of it, as follows $var1 = &$var2
Answer: “13” and 12 can be compared in PHP since it casts everything to the integer type.
Answer: The name of the output type have to be specified in parentheses before the variable which is to be cast as follows:
* (int), (integer) – cast to integer
* (bool), (boolean) – cast to boolean
* (float), (double), (real) – cast to float
* (string) – cast to string* (array) – cast to array
* (object) – cast to object
Answer: When the original if was followed by : and then the code block withoutbraces.
Answer: It is composed of three expressions: a condition, and two operands describing what instruction should be performed when the specified condition is true or false as follows:
Expression_1 ? Expression_2 : Expression_3;
Answer: The function func_num_args() is used to give the number of parameters passed into a function.
Answer: $$var2 contains the value 10.
Answer: :: is used to access static methods that do not require object initialization.
Answer: In PHP, objects passed by value.
Answer: No, a parent constructor have to be called explicitly as follows:parent::constructor($value)
Answer: __sleep returns the array of all the variables that need to be saved, while __wakeup retrieves them.
Answer: 1- Combining two variables as follows:
$variable1 = ‘Hello ‘;
$variable2 = ‘World’;
$variable3 = $variable1.$variable2;
Or
2- $variable3 = “$variable1$variable2”;
$variable3 will contain “Hello World”. The first code is faster than the second code especially for large large sets of data.
Answer: A session is a logical object enabling us to preserve temporary data across multiple PHP pages.
Answer: The use of the function session_start() lets us activating a session.
Answer: It is possible to propagate a session id via cookies or URL parameters.
Answer: A persistent cookie is permanently stored in a cookie file on the browser’s computer. By default, cookies are temporary and are erased if we close the browser.
Answer: Sessions automatically ends when the PHP script finishs executing, but can be manually ended using the session_write_close().
Answer: The session_unregister() function unregister a global variable from the current session and the session_unset() function free all session variables.
Answer: $GLOBALS is associative array including references to all variables which are currently defined in the global scope of the script.
Answer: $_SERVER is an array including information created by the web serversuch as paths, headers, and script locations.
Answer: $_FILES is an associative array composed of items sent to the current script via the HTTP POST method.
Answer: $_FILES[‘userfile’][‘name’] represents the original name of the file on the client machine,
$_FILES[‘userfile’][‘tmp_name’] represents the temporary filename of the file stored on the server.
Answer: $_FILES[‘userfile’][‘error’] contains the error code associated with theuploaded file.
Answer: We can change the maximum size of files to be uploaded by changing upload_max_filesize in php.ini.
Answer: $_ENV is an associative array of variables sent to the current PHP script via the environment method.
Answer: $_COOKIE is an associative array of variables sent to the current PHP script using the HTTP Cookies.
Answer: The scope of a variable is the context within which it is defined. For the most part all PHP variables only have a single scope. This single scope spans included and required files as well.
Answer: $a and $b: TRUE if both $a and $b are TRUE.
$a & $b: Bits that are set in both $a and $b are set.
Answer: The first is the concatenation operator (‘.’), which returns the concatenation of its right and left arguments. The second is (‘.=’), which appends the argument on the right to the argument on the left.
Answer: $a === $b TRUE if $a and $b have the same key/value pairs in the same order and of the same types.
Answer: != means inequality (TRUE if $a is not equal to $b) and !== means non-identity (TRUE if $a is not identical to $b).
Answer: To be able to verify whether a PHP variable is an instantiated object of a certain class we use instanceof.
Answer: The goto statement can be placed to enable jumping inside the PHP program. The target is pointed by a label followed by a colon, and the instruction is specified as a goto statement followed by the desired target label.
Answer: Exception::getMessage lets us getting the Exception message and Exception::getLine lets us getting the line in which the exception occurred.
Answer: Exception::__toString gives the String representation of the exception.
Answer: The function parse_ini_file() enables us to load in the ini file specified in filename, and returns the settings in it in an associative array.
Answer: The boolean function isset determines if a variable is set and is not NULL.
Answer: The string function strstr(string allString, string occ) returns part of allString from the first occurrence of occ to the end of allString. This function is case-sensitive. stristr() is identical to strstr() except that it is case insensitive.
Answer: for is expressed as follows:
for (expr1; expr2; expr3)
statement
The first expression is executed once at the beginning. In each iteration, expr2 is evaluated. If it is TRUE, the loop continues and the statements inside for are executed. If it evaluates to FALSE, the execution of the loop ends. expr3 is tested at the end of each iteration.
However, foreach provides an easy way to iterate over arrays and it is only used with arrays and objects.
Answer: It is possible to use the document.form.submit() function to submit the form. For example: <input type=button value=”SUBMIT” onClick=”document.form.submit()”>
Answer: The function eregi_replace() is identical to the function ereg_replace() except that it ignores case distinction when matching alphabetic characters.
Answer: Yes, we use the urlencode() function to be able to protect special characters.
Answer: The three basic classes of errors are notices (non-critical), warnings (serious errors) and fatal errors (critical errors).
Answer: \034 is octal 34 and \x34 is hex 34.
Answer: It is possible to pass the variables between the PHP pages using sessions, cookies or hidden form fields.
Answer: The use of the set_time_limit(int seconds) enables us to extend the execution time of a php script. The default limit is 30 seconds.
Answer: Yes, it is possible by setting the cookie with a past expiration time.
Answer: The default session time in php is until closing of browser
Answer: Yes, it’s possible to integrate (Distributed) Component Object Model components ((D)COM) in PHP scripts which is provided as a framework.
Answer: For finding length of string we use strlen() function and for array we use count() function.
Answer: We cannot change the value of a constant.
Answer: unset() is used to destroy a variable where as unlink() is used to destroy a file.
Answer: Both are used to split a string to array, the basic difference is that split() uses pattern for splitting and explode() uses a string. explode() is faster than split() as it does not match the string based on regular expression. Also split() is deprecated as of 5.3.0. So using of this function is discouraged.
Answer: The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. It is a data-access abstraction layer, so no matter what database we use the function to issue queries and fetch data will be same. Using PDO drivers we can connect to database like DB2, Oracle, PostgreSQL etc.
Answer: Javascript is a client side scripting language whereas PHP is a server side scripting language.
Answer: CSS or cascading Style Sheet is a way to style and present HTML.
Answer: The difference between an ID and Class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.
Answer: This is the encoding used to send image or files via form, The data will be split into multiple parts and, one for each files plus one for the text of the form body that may be sent with them.
Answer: AJAX (Asynchronous JavaScript and XML) is a technique which allows updating parts of a web page, without reloading the whole page. Data is exchanged asynchronously in small amounts of data with the server.
Answer: jQuery is a fast, small, and feature-rich JavaScript library. It is an easy-to-use API which makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler across a multitude of browsers.
Answer: Suppose we want to show and hide elements of a div with id div1.
Answer: SQL or Structured Query Language is a programming language designed for managing data held in a Relational Database Management System. Mysql is a open source, relational database management System.
Answer: Group By is used for retrieving information about a group of data. It is generally used with some aggregate function like SUM, AVG etc. ORDER BY is used to sort the records using column name. It can sort column in both ascending and descending order.
Answer: When we have to fetch records from more than one table we can use JOIN keyword. The process is known as joining the tables. There are various types of join like INNER JOIN, LEFT JOIN, RIGHT JOIN, and OUTER JOIN.
Answer: INNER Join compares two tables and only returns results where a match exists. Records from the 1st table are duplicated when they match multiple results in the 2nd. INNER joins tend to make result sets smaller, but because records can be duplicated this isn’t guaranteed.

LEFT join means keep all records from the 1st table no matter what and insert NULL values when the 2nd table doesn’t match.
RIGHT Join means the opposite: keep all records from the 2nd table no matter what and insert NULL values when the 1st table doesn’t match.
Answer: Sum function works on the column basis and will return the sum of that particular row only.
Answer: We use DISTINCT keyword.
Answer: count() is used for fetching the total number records in a table.
Answer: Suppose take an example where you need to fetch all customer data where name stats with sa
SELECT * FROM Customers WHERE name LIKE ‘sa%';
Another case is where you need to fetch all customer data where kumar is found irrespective of the position (middle name or last name).
SELECT * FROM Customers WHERE name LIKE ‘%kumar%';
Answer: Take an example
DELETE FROM customer WHERE cid=150;
In this case it will delete the record of the customer with customer id 150
Answer: DROP table customers;
It will drop the table customers
Answer: Rasmus Lerdorf
Answer: Hyper text Pre Processor
Answer: We can include a file using "include() " or "require()" function with file path as its parameter.
Answer: require() includes and evaluates a specific file, while require_once() does thatonly if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.
Answer: We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method
Answer: Eg : var $arr = array('apple', 'grape', 'lemon');
Answer: count() is used to count all elements in an array, or something in an object.
Answer: Setcookie ("sample", "ram", time()+3600);
Answer: eg : echo $_COOKIE["user"];
Answer: It can be used to store information on the server for future use.
Answer: Yes variable name case sensitive and we cannot start a variable with number like $6name as a valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
Answer: No, You can't send Ajax request if different protocal OR different host.For Example, the following table gives an overview of typical outcomes for checks against the URL"http://www.example.com/directory/about-us.html".
 
Compared URL Outcome Reason
http?//www.example.com/dir/pa Succe Same protocol and host
ge2.html ss  
http?//www.example.com/dir2/other.html Success Same protocol and host
http?//www.example.com:81/dir/other.html Failure Same protocol and host but different port
https://www.example.com/dir/other.html Failure Different protocol
http://en.example.com/dir/other.html Failure Different host
http://example.com/dir/other.html Failure Different host (exact match required)
http://v2.www.example.com/dir/other.html Failure Different host (exact match required)
http?//www.example.com:80/dir/other.html Don'tuse Port explicit. Depends on implementationin browser.

 
Answer: $string="cakephp and zend";
$array =explode('and',$string);
print_r($array);
Answer: $array = array('cakephp','zend');
$string =implode(' and ',$array);
echo $string;
Answer: $host = "localhost";
$username = "root";
$password = "";$conn = new mysqli($host, $username, $password);
//connect to server
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
Answer: $host = "localhost";
$username = "root";
$password = "";$conn = mysqli_connect($host, $username, $password);
//connect to server
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
Answer: $host = "localhost";
$username = "root";
$password = "";
$conn = new PDO("mysql:host=$host;dbname=myDB", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
Answer: $postData = array(
"site" => "web technology experts notes",
"dailyuser" => "1000",
"location" => "India"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
Answer: unset($_SESSION['object']);
Answer: session_destroy();
Answer: $file="full_path/filename.php"
unlink($file); //make sure you have enough permission to do delete the file.
Answer: $string="cakephp and zend";
echo strtoupper($string);
Answer: $string="CAKEPHP AND ZEND";
echo strtolower($string);
Answer: $string="cakephp and zend";
echo ucwords($string);
Answer: array_merge example
$array1 = array('one','two');
$array2 = array(1,2);
$result = array_merge($array1,$array2);
print_r($result);
array_combine example
$array1 = array('one','two');
$array2 = array(1,2);
$result = array_combine($array1,$array2);
print_r($result);



 
Answer: $array = array('one','two');
echo json_encode($array); //use json_decode for decode
Answer: $array = array('one','two');
echo serialize($array);//use unserialize for convert serialized string to array
Answer: $_SERVER['HTTP_USER_AGENT']
Answer: $array = array('cakephp','zend');
sizeof($array);
count($array);
Answer: parent::constructor()
Answer: Works in following Flow
1. Open website http://www.web-technology-experts-notes.in/
2. Request send to server of http://www.web-technology-experts-notes.in/
3. Call PHP Files.
4. PHP Scripts are loaded into memory and compiled into Zend opcode.
5. These opcodes are executed and the HTML generated.
6. Same HTML is send back to Browser.
Answer: Magic Quotes is a process that automagically escapes ncoming data to the PHP script. It's preferred to code with magic quotes off and to instead escape the data at runtime, as needed. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.
Answer: Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which allow code injection by malicious web users into the web pages viewed by other users. Examples of such code include HTML code and client-side scripts. SQL injection is a code injection technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed
Answer: Using URL rewriting we can convert dynamic URl to static URL Static URLs are known to be better than Dynamic URLs because of a number of reasons 1. Static URLs typically Rank better in Search Engines. 2. Search Engines are known to index the content of dynamic pages a lot slower compared to static pages. 3. Static URLs are always more friendlier looking to the End Users. along with this we can use URL rewriting in adding variables [cookies] to the URL to handle the sessions.
Answer: 1. Never include, require, or otherwise open a file with a filename based on user input, without thoroughly checking it first.
2. Be careful with eval() Placing user-inputted values into the eval() function can be extremely dangerous. You essentially give the malicious user the ability to execute any command he or she wishes!
3. Be careful when using register_globals = ON It was originally designed to make programming in PHP easier (and that it did), but misuse of it often led to security holes
4. Never run unescaped queries
5. For protected areas, use sessions or validate the login every time.
6. If you don ™t want the file contents to be seen, give the file a .php extension.
Answer: The SQL Server Driver for PHP v1.0 is designed to enable reliable, scalable integration with SQL Server for PHP applications deployed on the Windows platform. The Driver for PHP is a PHP 5 extension that allows the reading and writing of SQL Server data from within PHP scripts. using MSSQL or ODBC modules we can access Microsoft SQL server.
Answer: Model-view-controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model. WHY ITS NEEDED IS 1 Modular separation of function 2 Easier to maintain 3 View-Controller separation means:
A Tweaking design (HTML) without altering code B Web design staff can modify UIwithout understanding code
Answer: In general, a framework is a real or conceptual structure intended to serve as a support or guide for the building of something that expands the structure into something useful. Advantages : Consistent Programming Model Direct Support for Security Simplified Development Efforts Easy Application Deployment and Maintenance
Answer: CURL means Client URL Library
curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos ¦), file transfer resume, proxy tunneling and a busload of other useful tricks.
CURL allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates,HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP ™s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.
Answer: The PDO ( PHP Data Objects ) extension defines a lightweight, consistent interface for accessing databases in PHP. if you are using the PDO API, you could switch the database server you used, from say PgSQL to MySQL, and only need to make minorchanges to your PHP code.
While PDO has its advantages, such as a clean, simple, portable API but its maindisadvantage is that it doesn’t allow you to use all of the advanced features that are available in the latest versions of MySQL server. For example, PDO does not allow you to use MySQL’s support for Multiple Statements.
Just need to use below code for connect mysql using PDO
try {
$dbh = new PDO(“mysql:host=$hostname;dbname=databasename”, $username, $password);
$sql = “SELECT * FROM employee”;
foreach ($dbh->query($sql) as $row)
{
print $row['employee_name'] .’ – ‘. $row['employee_age'] ;
}
}
catch(PDOException $e)
{
echo $e->getMessage();
}
 
Answer: The mysqli extension, or as it is sometimes known, the MySQL improved extension, was developed to take advantage of new features found in MySQL systems versions4.1.3 and newer. The mysqli extension is included with PHP versions 5 and later.The mysqli extension has a number of benefits, the key enhancements over the mysql extension being:
=>Object-oriented interface
=>Support for Prepared Statements
=>Support for Multiple Statements
=>Support for Transactions
=>Enhanced debugging capabilities
=>Embedded server support
Answer: The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.
Answer: A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
Answer: PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusablePHP components. It eases installation by bringing an automated wizard, and packingthe strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install “packages”
PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide:
A structured library of open-sourced code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHPThe PHP Foundation Classes (PFC),
The PHP Extension Community Library (PECL),
A web site, mailing lists and download mirrors to support the PHP/PEAR communityPEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite alot of people have joined the project since then.
Answer: Simple arithmetic:
$date1 = date(‘Y-m-d’);
$date2 = ’2006-07-01?;
$days = (strtotime() – strtotime()) / (60 * 60 * 24);
echo “Number of days since ’2006-07-01?: $days”;
Answer: The syntex for repairing a mysql table is:
REPAIR TABLE tablename
REPAIR TABLE tablename QUICK
REPAIR TABLE tablename EXTENDED
This command will repair the table specified.
If QUICK is given, MySQL will do a repair of only the index tree.
If EXTENDED is given, it will create index row by row.
Answer: $message is a simple variable whereas $$message is a reference variable. Example:
$user = ‘bob’
is equivalent to
$holder = ‘user’;
$$holder = ‘bob’;Anwser 2:
They are both variables. But $message is a variable with a fixed name. $$message is a variable who’s name is stored in $message. For example, if $message contains “var”, $$message is the same as $var.
Answer: A persistent cookie is a cookie which is stored in a cookie file permanently on the browser’s computer. By default, cookies are created as temporary cookies which stored only in the browser’s memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:
*Temporary cookies can not be used for tracking long-term information.
*Persistent cookies can be used for tracking long-term information.
*Temporary cookies are safer because no programs other than the browser can access them.
*Persistent cookies are less secure because users can open cookie files see the cookievalues.
Answer: The output is displayed directly to the browser.
 
Answer: Via define() directive, like define (“MYCONSTANT”, 100);
Answer: require_once() and include_once() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.But require() and include() will do it as many times they are asked to do.
The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. The major difference between include() and require() is that infailure include() produces a warning message whereas require() produces a fatal errors.
Answer: urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode(“10.00%”) will return “10.00%′′. URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.String urlencode(str) – Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encodedversion:
Alphanumeric characters are maintained as is.Space characters are converted to “+” characters.
Other non-alphanumeric characters are converted “%” followed by two hex digits representing the converted character.
string urldecode(str) – Returns the original string of the input URL encoded string.
For example:
$discount =”10.00%”;
$url = “http://domain.com/submit.php?disc=”.urlencode($discount);
echo $url;You will get “http://domain.com/submit.php?disc=10.00%??.
Answer: Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
$_FILES[$fieldName]['name'] – The Original file name on the browser system.
$_FILES[$fieldName]['type'] – The file type determined by the browser.
$_FILES[$fieldName]['size'] – The Number of bytes of the file content.
$_FILES[$fieldName]['tmp_name'] – The temporary filename of the file in which the uploaded file was stored on the server.
$_FILES[$fieldName]['error'] – The error code associated with this file upload.The $fieldName is the name used in the .
Answer: MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array
Answer: Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
Answer: • first of all instead of using select * from table1, use select column1, column2, column3.. from table1
• Look for the opportunity to introduce index in the table you are querying.
• use limit keyword if you are looking for any specific number of rows from the result set.
Answer: session_id() returns the session id for the current session.
Answer: session_unregister – Unregister a global variable from the current sessionsession_unset – Free all session variables
Answer: By using setcookie(name, value, expire, path, domain); function we can set the cookie in php ;
Set the cookies in past for destroy. like
setcookie(“user”, “sonia”, time()+3600); for set the cookie
setcookie(“user”, “”, time()-3600); for destroy or delete the cookies;
 
Answer: • GET/QueryString
• POST
Answer: eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic
characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.
Answer: Sort(), arsort(),
asort(), ksort(),
natsort(), natcasesort(),
rsort(), usort(),
array_multisort(),
anduksort().
Answer: 2 ways
a) sizeof($urarray) This function is an alias of count()
b) count($urarray)
Answer: session_set_save_handler() sets the user-level session storage functions which are used for storing and retrieving data associated with a session. This is most useful when a storage method other than those supplied by PHP sessions is preferred. i.e. Storing the session data in a local database.
Answer: bool is_numeric ( mixed var)
Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number.
Answer: Case Studio
Smart Draw
Answer: we can always fetch from one database and rewrite to another. here is a nice solutionof it.$db1 = mysql_connect(“host”,”user”,”pwd”)
mysql_select_db(“db1??, $db1);
$res1 = mysql_query(“query”,$db1);$db2 = mysql_connect(“host”,”user”,”pwd”)
mysql_select_db(“db2??, $db2);
$res2 = mysql_query(“query”,$db2);At this point you can only fetch records from you previous ResultSet,
i.e $res1 “ But you cannot execute new query in $db1, even if you supply the link as because the link was overwritten by the new db.so at this point the following script will fail
$res3 = mysql_query(“query”,$db1); //this will failSo how to solve that? take a look below.
$db1 = mysql_connect(“host”,”user”,”pwd”)
mysql_select_db(“db1??, $db1);
$res1 = mysql_query(“query”,$db1);
$db2 = mysql_connect(“host”,”user”,”pwd”, true)
mysql_select_db(“db2??, $db2);
$res2 = mysql_query(“query”,$db2);
So mysql_connect has another optional boolean parameter which indicates whether alink will be created or not. as we connect to the $db2 with this optional parameter setto ‘true’, so both link will remain live.
now the following query will execute successfully.
$res3 = mysql_query(“query”,$db1);
Answer: Directory
stdClass__PHP_Incomplete_Class
exception
php_user_filter
Answer: You can maintain two separate language file for each of the language. all the labels are putted in both language files as variables and assign those variables in the PHP source. on runtime choose the required language option.
Answer: Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract.
Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods onlydeclared but not defined. All the methods must be define by its implemented class.
Answer: JavaScript does not have any networking capabilities as it is designed to work on client site. As a result we can not send mails using JavaScript. But we can call the client side mail protocol mailto via JavaScript to prompt for an email to send. this requires the client to approve it.
Answer: The syntex for repairing a MySQL table isREPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]This command will repair the table specified if the quick is given the MySQL will doa repair of only the index tree if the extended is given it will create index row by row
Answer: A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don’t need to keep re-issuing the entire querybut can refer to the stored procedure.
This provides better overall performance because the query has to be parsed onlyonce, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of
the work is done on the server side and less on the client (application) side.Triggers will also be implemented. A trigger is effectively a type of stored procedure, one thatis invoked when a particular event occurs.
For example, you can install a stored procedure that is triggered each time a record isdeleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly.Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data.If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. Ifyou need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.
Answer: The following table describes the maximum length for each type of identifier.Identifier Maximum Length
(bytes)
Database64
Table 64
Column 64
Index 64
Alias 255
There are some restrictions on the characters that may appear in identifiers.
Answer: MySQL set can take zero or more values but at the maximum it can take 64 values
Answer: describe Table-Name;
Answer: The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,
Answer: In MySql, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,
Answer: If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint. The efficiency of the operating systemin handling large numbers of files in a directory can place a practical limit on the  number of tables in a database. If the time required to open a file in the directory increases significantly as the number of files increases, database performance can be adversely affected.
The amount of available disk space limits the number of tables.
MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 1 bytes). With this larger allowed table size, the maximum effective table sizefor MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits.The InnoDB storage engine maintains InnoDB tables within a tablespace that can be created from several files. This allows a table to exceed the maximum individual file size. The tablespace can include raw disk partitions, which allows extremely large tables. The maximum tablespace size is 64TB.
The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive.For the most up-to-date information, be sure to check the documentation specific to your operating system.Operating System File-size LimitLinux 2.2-Intel 32-bit 2GB (LFS: 4GB)Linux 2.4+ (using ext3 filesystem) 4TB
Solaris 9/10 16TB
NetWare w/NSS filesystem 8TB
Win32 w/ FAT/FAT32 2GB/4GB
Win32 w/ NTFS 2TB (possibly larger)
MacOS X w/ HFS+ 2TB
Answer: The generic syntax for grant is as following
> GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY [password]
now rights can be
a) All privileges
b) combination of create, drop, select, insert, update and delete etc.We can grant rights on all databse by using *.* or some specific database by database.* or a specific table by database.table_name username@hotsname can be either username@localhost, username@hostname and username@% where hostname is any valid hostname and % represents any name, the *.* any condition password is simply the password of userThe generic syntax for revoke is as following> REVOKE [rights] on [database/s] FROM [username@hostname]   now rights can be as explained above
a) All privileges
b) combination of create, drop, select, insert, update and delete etc. username@hotsname can be either username@localhost, username@hostname and username@% where hostname is any valid hostname and % represents any name, the *.* any condition
Answer: The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms, but the lasttwo are mainly academic and will not be discussed).First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic).Second Normal FormWhere the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form.Third Normal FormI have a confession to make; I do not often use Third Normal Form. In Third NormalForm we are looking for data in our tables that is not fully dependant on the primary key, but dependant on another value in the table
Answer: Use this for mysql
>SELECT COUNT(*) FROM table_name;
Answer: $result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo “$num_rows rows found”;
Answer: SELECT CURDATE();
CURRENT_DATE() = CURDATE()
for time use
SELECT CURTIME();
CURRENT_TIME() = CURTIME()
Answer: External Style SheetsAdvantagesCan control styles for multiple documents at once. Classes can be created for use on multiple HTML element types in many documents.Selector and grouping methods can be used to apply styles under complex contextsDisadvantagesAn extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitions Embedded Style Sheets
Advantages
Classes can be created for use on multiple tag types in the document.Selector and grouping methods can be used to apply styles under complex contexts. No additional downloads necessary to receive style information
Disadvantages
This method can not control styles for multiple documents at once Inline Styles
Advantages
Useful for small quantities of style definitions. Can override other style specificationmethods at the local level so only exceptions need to be listed in conjunction with other style methods
Disadvantages
Does not distance style information from content (a main goal of SGML/HTML). Can not control styles for multiple documents at once.
Author can not create or control classes of elements to control multiple element types within the document. Selector grouping methods can not be used to create complex element addressing scenarios
Answer: In PHP an extended class is always dependent on a single base class, that is, multipleinheritance is not supported. Classes are extended using the keyword ‘extends’.
Answer: Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL.
Unique Key: Unique Keys are used to uniquely identify each row in the table. Therecan be one and only one row for each unique key value. So NULL can be a unique key.There can be only one primary key for a table but there can be more than one unique for a table.
Answer: Garbage Collection is an automated part of PHP , If the Garbage Collection process runs, it then analyzes any files in the /tmp for any session files that have not been accessed in a certain amount of time and physically deletes them. GarbageCollection process only runs in the default session save directory, which is /tmp. If you opt to save your sessions in a different directory, the Garbage Collection processwill ignore it. the Garbage Collection process does not differentiate between which sessions belong to whom when run. This is especially important note on shared web servers. If the process is run, it deletes ALL files that have not been accessed in the directory. There are 3 PHP.ini variables, which deal with the garbage collector: PHP ini value name default session.gc_maxlifetime 1440 seconds or 24 minutes session.gc_probability 1 session.gc_divisor 100
Answer: Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP.
Answer: ORDER BY [col1],[col2], ¦,[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.
GROUP BY [col1],[col2], ¦,[coln];
Tels DBMS to group results with same value of column col1.
You can use COUNT(col1), SUM(col1), AVG(col1) with it,if you want to count all items in group, sum all values or view average
Answer: Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m bytes
Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes
eg. name char(15) will waste 10 bytes if we store ‘romharshan’, if each char takes a byte
eg. name varchar(15) will just use 5 bytes if we store ‘romharshan’, if each chartakes a byte. rest 10 bytes will be free.
Answer: Calculate the md5 hash of a string. The hash is a 32-characterhexadecimal number.I use it to generate keys which I use to identify users etc. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using.
Answer: you can use LOAD DATA INFILE file_name; syntax to load data from a text file. but you have to make sure that
a) data is delimited
b) columns and data matched correctly
Answer: SELECT DATEDIFF(“2007-03-07′′,”2005-01-01′′);
Answer: $date1 = date(“Y-m-d”);
$date2 = “2006-08-15??;
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
Answer: Email functionality isinbuilt with PHP.
PHP providemail() with use of this, we can sen an email to user or subscriber.
We can sendhtml/textemail.
We can sendattachmentwith email.
We can also use option likecc, bc and bcc.
We can also set the values inheader.
We can also use third party API like (gmail, yahoo etc) to send email.
Answer: Create an session in PHP.
Session data is stored in Server.
Session data have unique name.
Session unique key with domain name is stored in browser cookie.
Now, Browser keep the login with use of unique key(in cookie) and session data (stored in server side).
Answer: unlink: delete the files from Server.
unset: delete the variable name and data from memory.
Answer: With use virtual host and htaccess, you can create sub domain.
Answer: Session
Cookie
Database
URL parameters
Answer: $_COOKIE– Stored information in Cookie.
$_GET– Send data in URL as paramter.
$_POST– Send data to server OR Page as POST Method.
$_REQUEST– Its combined array containing values from the $_GET, $_POSTand $_COOKIES.
$_ENV– Get/Set varaible in environment.
$_FILES– Used to upload the file, image and videos etc.
$_SERVER– It have all server information.
$GLOBALS– Contains all the global variables associated with the current script.
Answer: echo $_SESSION['REMOTE_ADDR'];
Answer: Single inheritance.
Multiple Level inheritance.
Answer: CMS meansContent Management System. It is web software who provide the websitefull fledgedcontent management where owner can add/update/delete thehtml/files/images/videos etc. Today's CMS do much more as compare to its name.
For example. Joomla/Wordpress is CMS but you can createE-commerercewebsite and can accpet all types of payment.
In Today's CMS, you can create many different types of website like Ecommerce website, Personal blogging and Forum etc.
Answer: echo md5(uniqid(rand(), true));
Answer: echoconstructor which is used to display the value in browser.
printis function which is used to display and return the value.
Answer: \023 is octal 23.
\x23 is hex 23.
Answer: PHP: php 5.5
Apache: Apache 2.2
MySQL: MySQL 5.5
Answer: E_ERROR: A fatal error that causesscript termination
E_WARNING: Run-time warning thatdoes not cause script termination
E_ALL: Catches all errors andwarnings
E_PARSE: Compile time parse error.
E_NOTICE: Run time notice caused dueto error in code
E_USER_WARNING: User-generatedwarning message.
E_USER_ERROR: User-generated errormessage.
E_USER_NOTICE: User-generated noticemessage.
E_STRICT: Run-time notices.
E_RECOVERABLE_ERROR: Catchable fatalerror indicating a dangerous error
 
Answer: Depend on Operating System
Answer: MultipurposeInternetMailExtensions.
WWW ability to recognize and handle files of different types is largely dependent onthe use of the MIME (Multipurpose Internet Mail Extensions) standard. The standardprovides for a system of registration of file types with information about the applications needed to process them.
Answer: Persistent cookie is a cookie which is permanently stored on user’s computer in a cookie file. They are used for tracking the user information of the users who are browsing from a very long time. They also have the drawbacks of being unsecure, asuser can see the cookies which are saved on the computer.
Answer: PHP can't read the hash portion of the URL
index.php?page=group#birthday
Here, PHP can not read the birthday
There is some by which you can get this valueget the value by javascript and then set to cookie or pass in ajax. See Example
var query = location.href.split('#');
[removed]s = 'hasValue=' + query[1];
Answer: 1. Static methods are that can be accessed by using the scope resolution operator (i.e ::) and object reference operator ( i.e.-> ).
For example HelloClass::mystatic(); $helloClass->mystatic();
class MyClass{
static function mystatic() {
echo "this was declared static!\n";
}
}
$obj = new MyClass();
MyClass::mystatic();
$obj->mystatic();
Answer: 1. You use static when you want to use a method / variable that is not tied to an instance.
2. When you want to persistent value throughout multiple call of function.
3. For singleton pattern, we use static method/variable.
4. it is very usefull for caching if a method will be called very often and do just the same thing. For example see below
protected function is_logged_in() {
static $logged_in = null;
if($logged_in != null) {
return $logged_in;
}
//Check shibboleth headers
if (!empty($_SERVER['HTTP_SHIB_IDENTITY_PROVIDER']) || !
empty($_SERVER['Shib-Identity-Provider'])) {
if (!empty($_SERVER[$this->core->dbconfig("shib_auth", self::SHIB_AUTH_CONFIG_UID)])) {
$logged_in = true;
return true;
}
}
$logged_in = false;
return false;
}
 
Answer: 1) Make a zip of sql dump file and upload the zip file to server through FTP.
2) Login to Putty/Console
3) Go the directory with use of cd command, the location where you have upload thezip file.
4) unizip that zip file, with following command
unzip zipfilename.zip
3)Import the sql dump file with use of following command.
mysql -u username -p databasename < sqlfilename>
(It will for prompt password)
 
Answer: 1) Login to Putty/Console
2) Go to the directory where your file exist (suppose file name is file.zip)
3) Use the following command to copy the file frome current server to another server
scp file.zip username@hostname:/foldername
(It will prompt password)
(username, hostname is another server)
 
Answer: 1) Login to Putty/Console
2) Execute following commands to export the sql dump into server.
mysqldump –u username –p databasename tablename > sqlfilename.sql
(It will prompt password)
Answer:
mysql –u username –p databasename tablename < sqlfilename>
(It will prompt for password)
 
Answer: Responsive web design (RWD) is a web design approach aimed at crafting sites to provide an optimal viewing experience, easy navigation and reading with a minimum of scrolling, resizing and panning. across a wide range of devices (all mobiles, desktop, laptop, ipad etc).
Answer: To backup: BACKUP TABLE tbl_name[,tbl_name ¦] TO
‘/path/to/backup/directory’
RESTORE TABLE tbl_name[,tbl_name ¦] FROM
‘/path/to/backup/directory’mysqldump: Dumping Table Structure and DataUtility to
dump a database or a collection of database for backup or
for transferring the data to another SQL server (not necessarily a MySQL
server). The dump will contain SQL statements to create the table and/or
populate the table.
-t, no-create-info
Don’t write table creation information (the CREATE TABLE statement).
-d, “no-data
Don’t write any row information for the table. This is very useful if
you just want to get a dump of the structure for a table!
encryption decryption
AES_ENCRYT() AES_DECRYPT()
ENCODE() DECODE()
DES_ENCRYPT() DES_DECRYPT()
ENCRYPT() Not available
MD5() Not available
OLD_PASSWORD() Not available
PASSWORD() Not available
SHA() or SHA1() Not available
Not available UNCOMPRESSED_LENGTH()


 
Answer: by using spl_autoload_register(‘autoloader::funtion’);
Like below
class autoloader
{
public static function moduleautoloader($class)
{
$path = $_SERVER['DOCUMENT_ROOT'] . “/modules/{$class}.php”;
if (is_readable($path)) require $path;
}
public static function daoautoloader($class)
{
$path = $_SERVER['DOCUMENT_ROOT'] . “/dataobjects/{$class}.php”;
if (is_readable($path)) require $path;
}
public static function includesautoloader($class)
{
$path = $_SERVER['DOCUMENT_ROOT'] . “/includes/{$class}.php”;
if (is_readable($path)) require $path;
}
}
spl_autoload_register(‘autoloader::includesautoloader’);
spl_autoload_register(‘autoloader::daoautoloader’);
spl_autoload_register(‘autoloader::moduleautoloader’);
Answer: As far PHP concern it only support single Inheritance in scripting.we can also use interface to achieve multiple inheritance.
Answer: Using Disposition-Notification-To: in mailheader we can get read receipt.Add the possibility to define a read receipt when sending an email.It’s quite straightforward, just edit email.php, and add this at vars definitions:
var $readReceipt = null;
And then, at ‘createHeader’ function add:
if (!empty($this->readReceipt)) {
$this->__header .= ‘Disposition-Notification-To: ‘ . $this->__formatAddress($this- >readReceipt) . $this->_newLine;
}
Answer: default session time in PHP is 1440 seconds or 24 minutesDefault session save path id temporary folder /tmp
Answer: By checking the session variable exist or not while loading th page. As the session will exist longer as till browser closes. The default behaviour for sessions is to keep a sessionopen indefinitely and only to expire a session when the browser is closed. This behaviour can be changed in the php.ini file by altering the line session.cookie_lifetime = 0 to a value in seconds. If you wanted the session to finish in 5 minutes you would set this to session.cookie_lifetime = 300 and restart your httpd server.
Answer: whenever a user logs in track the IP, userID etc..and store it in a DB with a active flag while log out or sesion expire make it inactive. At any time by counting the no: of activerecords we can get the no: of visitors.
Answer: The PDF functions in PHP can create PDF files using the PDFlib library With version 6, PDFlib offers an object-oriented API for PHP 5 in addition to the function-oriented API for PHP 4. There is also the » Panda module. FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F fromFPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs. FPDF requires no extension (except zlib to activate compression and GD for GIF support) and works with PHP4 and PHP5.
Answer: we will need to compile PHP with the GD library of image functions for this to work. GD and PHP may also require other libraries, depending on which image formats you want to work with.
Answer: A design pattern is a general reusable solution to a commonly occurring problem in software design.
The Singleton design pattern allows many parts of a program to share a single resource without having to work out the details of the sharing themselves.
Answer: PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
Answer: In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like “{$a},000,000 mln dollars”, then you definitely need to use the braces.
Answer: Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
MyISAM is the default storage engine as of MySQL 3.23. When you fire the above create query MySQL will create a MyISAM table.
Answer: If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script:
Remember that mysql_query() returns TRUE/FALSE on CREATE statements. If you run this script, you will get something like this:Table Tech_links created.
Answer: You can encrypt a password with the following Mysql>SET
PASSWORD=PASSWORD(“Password”);
You can also use the MySQL PASSWORD() function to encrypt username and password. For example,
INSERT into user (password, ...) VALUES (PASSWORD($password”)), ...);
Answer: string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive.stristr() is idential to strstr() except that it is case insensitive.
Answer: When the original if was followed by : and then the code block without braces.
Answer: No. There is no way to send emails directly using JavaScript.But you can use JavaScript to execute a client side email program send the email using the “mailto” code.
Here is an example:
function myfunction(form)
{
tdata=document.myform.tbox1.value;
location=”mailto:mailid@domain.com?subject=...”;
return true;
}
Answer: strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr(“user@example.com”,”@”) will return “@example.com”.
stristr() is idential to strstr() except that it is case insensitive.
 
Answer: eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters.
Answer: func_num_args() function returns the number of parameters passed in.
Answer: In MySQL, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin withthe table name and have an extension to indicate the file type.
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,
Answer: MIME - Multi-purpose Internet Mail Extensions.
MIME types represents a standard way of classifying file types over Internet.
Web servers and browsers have a list of MIME types, which facilitates files transfer of the same type in the same way, irrespective of operating system they are working in.
A MIME type has two parts: a type and a subtype. They are separated by a slash (/).
MIME type for Microsoft Word files is application and the subtype is msword, i.e. application/msword.Explain how to execute a PHP script using command line.PHP script using command line can be executed using SAPI (Server Application programming Interface). Using SAPI Command Line Interface the PHP code can be passed to execute directly
 
Answer: By default the PHP script takes 30secs to execute. This time is set in the php.ini file. This time can be increased by modifying the max_execution_time in seconds. The time must be changed keeping the environment of the server. This is because modifying the execution time will affect all the sites hosted by the server.Explain the purpose of output buffering in PHP.
Output buffering in PHP buffers a scripts output. This buffer can be edited before returning it to the client. Without output buffering, PHP sends data to the web server as soon as it is ready. Output buffering "send" cookies at any point in the script. Cookies donot have to be necessarily sent near the start of page. Output buffers are stackable and hence sending to output is by choice.How can we know the number of days between twogiven dates using PHP?
The start date and end date can be first found as shown below:
$date1= strotime($start_date);
$date2= strotime($end_date);
$date_diff = (($date1)- ($date2)) / (60*60*24)Write the statements that are used to connect PHP with MySQL
The statements that can be used to connect PHP wil MySQL is:
<?
$conn = mysql_connect('localhost');
echo $conn;
?>
This statement gets the resource of the localhost. There are other different ways with which you can connect to the database and they are as follows:
<?
mysql_connect('db.domain.com:33306','root','user');
mysql_connect('localhost:/tmp/mysql.sock');
mysql_connect('localhost','rasmus','foobar',
true,MYSQL_CLIENT_SSL|MYSQL_CLIENT_COMPRESS);
?>How to use HTTP Headers inside PHP? Write the statement through which it can be added?
HTTP headers can be used in PHP by redirection which is written as:
<?header('Location: http://www.php.net')?>
Answer: PHP is rapidly gaining the popularity and many companies are switching their current language for this language. PHP is a server side scripting language. PHP executes the instructions on the server itself. Server is a computer where the web site is located. PHP is used to create dynamic pages and provides faster execution of the instructions.Why PHP is sometimes called as embedded scripting language?
PHP is a high level language which is used to allow users to write and understand it in human readable form and also use an interpreter to interpret the code which user write for the computer. PHP is used as an embedded scripting language for the web. PHP is embedded in HTML code. HTML tags are used to enclose the PHP language. HTML is used and PHP is code written in it in the same way as you write JavaScript in HTML.What is difference between require_once(), require(), include()?
require() includes and evaluates a specific file, if the file is not found then it shows a Fatal Error.
require_once() includes only the file which is not being included before. It is used to be recommended for the files where you have lots of functions stored.
include() includes the file, even if the file is not found, but it gives a warning to the user to include().PHP being an open source is there any support available to it?PHP is an open source language, and it is been said that it has very less support online and offline. But, PHP is all together a different language that is being developed by group of programmers, who writes the code. There is lots of available support for PHP, which mostly comes from developers and PHP users.
Answer: PHP function start with "functionfunction-name()".
PHP Function name must be start withcharacterand it acceptalphanumericand_.
In build functions arecase in-sensitive.
User build functions arecase sensitive.
We can pass upto 64 parameter as argument.
Anonymous functionare user defined function which have "no-name" and also called closures.
PHP supportvariable functions. Means when you can call a function using variable.
In same file OR under same class, same function name can't be created.
Answer: htmlentitiesis used to convert all applicable characters to HTML entities.It is used to stop the user from running malicious code in HTML.With use of htmlentities, user can't run the html tags like h2, p, script etc. It helps to prevent you fromXSS attack.
echo htmlentities($userData);
Answer: If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode():
<?php
print(“<html>”);
print(“

Please click the links below”
.” to submit comments about TECHPreparation.com:

”);
$comment = ‘I want to say: “It\’s a good site! :->”‘;
$comment = urlencode($comment);
print(“


.”
.”It’s an excellent site!

”);
$comment = ‘This visitor said: “It\’s an average site! “‘;
$comment = urlencode($comment);
print(“


.’
.”It’s an average site.

”);
print(“</html>”);
?>
Answer: Everything is passed by value.
Answer: Rasmus Lerdorf is known as the father of PHP.
Answer: $name is variable where as $$name is reference variable like $name=sonia and $$name=singh so $sonia value is singh.
Answer: GET and POST
Answer: <?php
echo $_SERVER[‘HTTP_USER_AGENT’].”\n\n”;
$browser=get_browser(null,true);
print_r($browser);
?>
Answer: A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
Answer: <?php
session_register($ur_session_var);
?>
Answer: Register the variable into the session
Pass the variable as a cookie
Pass the variable as part of the URL
Answer: sizeof($array_var)
count($array_var)
Answer: mysql_create_db();
Answer: strstr() returns part of a given string from the first occurrence of a given substring to the end of the string.
For example:strstr("user@example.com","@") will return "@example.com".stristr() is idential to strstr() except that it is case insensitive.
Answer: CRYPT(), MD5()
Answer: move_uploaded_file( string filename, string destination)
Answer: The mysql_error() message will tell us what was wrong with our query, similar to the message we would receive at the MySQL console.
Answer: CONSTRUCTOR : PHP allows developers to declare constructor methods for classes. Classes which have a constructor method call this method on each newly-created object, so it is suitable for any initialization that the object may need before it is used.
DESTRUCTORS : PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++. The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed or in any order in shutdown sequence.
Answer: The visibility of a property or method must be defined by prefixing the declaration with the keywords public, protected or private.
Class members declared public can be accessed everywhere.
Members declared protected can be accessed only within the class itself and by inheritedand parent classes.
Members declared as private may only be accessed by the class that defines the member.
Answer: There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for requestBut in POST method unlimited data can we send
2. when we use GET method requested data show in url butNot in POST method so POST method is good for send sensetive request
Answer: Both include and require used to include a file but when included file not foundInclude send Warning where as Require send Fatal Error
Answer: The header() function sends a raw HTTP header to a client.We can use herder()function for redirection of pages. It is important to notice that header() mustbe called before any actual output is seen.
Answer: Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter
Answer: In PHP an extended class is always dependent on a single base class,that is, multiple inheritance is not supported. Classes are extended using the keyword 'extends'.
Answer: You can encrypt a password with the following Mysql>SET PASSWORD=PASSWORD("Password");
We can encode data using base64_encode($string) and can decode using base64_decode($string);
Answer: Split function splits string into array by regular expression. Explode splits a string into array by string.
For Example:explode(" and", "India and Pakistan and Srilanka"); split(" :", "India : Pakistan : Srilanka");
Both of these functions will return an array that contains India, Pakistan, and Srilanka.
Copyright @ 2020 Yahoo Baba