0% found this document useful (0 votes)
7 views

Hypertext Preprocessor: Pear PHP Extension and Application Repository

Uploaded by

Harsh Goel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Hypertext Preprocessor: Pear PHP Extension and Application Repository

Uploaded by

Harsh Goel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1) What is PHP?

PHP stands for Hypertext Preprocessor. It is an open source server-side scripting


language which is widely used for web development. It supports many databases like
MySQL, Oracle, Sybase, Solid, PostgreSQL, generic ODBC etc.

What is PEAR in PHP?


PEAR is a framework and repository for reusable PHP components. PEAR stands for PHP
Extension and Application Repository. It contains all types of PHP code snippets and
libraries.

3) Who is known as the father of PHP?


Rasmus Lerdorf

4) What was the old name of PHP?


The old name of PHP was Personal Home Page.

5) Explain the difference b/w static and dynamic websites?


In static websites, content can't be changed after running the script. You can't change
anything on the site. It is predefined.

In dynamic websites, content of script can be changed at the run time. Its content is
regenerated every time a user visit or reload. Google, yahoo and every search engine
is the example of dynamic website.

6) What is the name of scripting engine in PHP?


The scripting engine that powers PHP is called Zend Engine 2.

7) Explain the difference between PHP4 and PHP5.


PHP4 doesn't support oops concept and uses Zend Engine 1.

PHP5 supports oops concept and uses Zend Engine 2.


10) Which programming language does PHP resemble to?
PHP has borrowed its syntax from Perl and C.

12) What is "echo" in PHP?


PHP echo output one or more string. It is a language construct not a function. So the
use of parentheses is not required. But if you want to pass more than one parameter
to echo, the use of parentheses is required.

13) What is "print" in PHP?


PHP print output a string. It is a language construct not a function. So the use of
parentheses is not required with the argument list. Unlike echo, it always returns 1.

1. int print ( string $arg)

14) What is the difference between "echo" and "print" in


PHP?
Echo can output one or more string but print can only output one string and always
returns 1.

Echo is faster than print because it does not return any value.

15) How a variable is declared in PHP?


A PHP variable is the name of the memory location that holds data. It is temporary
storage.

16) What is the difference between $message and


$$message?
$message stores variable data while $$message is used to store variable of variables.

$message stores fixed data whereas the data stored in $$message may be changed
dynamically.

17) What are the ways to define a constant in PHP?


PHP constants are name or identifier that can't be changed during execution of the
script. PHP constants are defined in two ways:
o Using define() function
o Using const() function

18) What are magic constants in PHP?


PHP magic constants are predefined constants, which change based on their use. They
start with a double underscore (__) and end with a double underscore (__).

19) How many data types are there in PHP?


PHP data types are used to hold different types of data or values. There are 8 primitive
data types which are further categorized in 3 types:

o Scalar types
o Compound types
o Special types

21) What are the different loops in PHP?


For, while, do-while and for each.

22) What is the use of count() function in PHP?


The PHP count() function is used to count total elements in the array, or something an
object.

23) What is the use of header() function in PHP?


The header() function is used to send a raw HTTP header to a client. It must be called
before sending the actual output. For example, you can't print any HTML element
before using this function.

24) What does isset() function?


The isset() function checks if the variable is defined and not null.

You might also like