Notices, Warnings and Fatal errors are the types of errors in PHP Notices: Notices represents non-critical errors, ie 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 ie calling include() a file which does not exist By default, these errors are displayed to the user Fatal errors: Fatal errors are critical errors ie calling a non-existent function or class These errors cause the immediate termination of the script
Correct Answer: $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
Correct Answer: echo() 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
Correct Answer: PEAR(PHP Extension and Application Repository) is a framework and repository for reusable PHP components PEAR is a code repository containing all kinds of php code snippets and libraries PEAR also offers a command-line interface that can be used to automatically install "packages"
Correct Answer: PHP: Hypertext Preprocessor is open source server-side scripting language that is widely used for web development PHP scripts are executed on the server PHP allows writing dynamically generated web pages efficiently and quickly The syntax is mostly borrowed from C, Java and perl PHP is free to download and use
Correct 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 versions 413 and later The mysqli extension has a number of benfits,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
Correct 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, ie application/msword
7. Why many companies are switching their current business language to PHP? Where PHP basically used?
Correct 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
8. What is the difference between PHP and JavaScript?
Correct 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
9. How can we increase the execution time of a php script?
Correct Answer: By the use of void set_time_limit(int seconds) Set the number of seconds a script is allowed to run If this is reached, the script returns a fatal error The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the phpini If seconds is set to zero, no time limit is imposed When called, set_time_limit() restarts the timeout counter from zero In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out
10. What is the use of super-global arrays in PHP?
Correct Answer: Super global arrays are the built in arrays that can be used anywhere They are also called as auto-global as they can be used inside a function as well The arrays with the longs names such as $HTTP_SERVER_VARS, must be made global before they can be used in an array This $HTTP_SERVER_VARS check your phpini setting for long arrays