home   Query   contact
meet the crew
have a look
what we do
step forward
our Album
PHP Question & Answer  Back
What is stand for PHP ? Who is the father of php ?

PHP : Hypertext Pre-Processor
Rasmus Lerdorf from England is Father of PHP
What are the differences between Get and post methods in form submitting, give the  case where we can use get and we can use post methods?

In the get method the data made available to the action page ( where data is received ) by the URL so data can be seen in the address bar. Not advisable if you are sending login info like password etc.
In the post method the data will be available as data blocks and not as query string in case of get method.

What is the difference between mysql_fetch_object and mysql_fetch_array?

MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array

Where to Start?

To get access to a web server with PHP support, you can:

  • Install Apache (or IIS) on your own server, install PHP, and MySQL
  • Or find a web hosting plan with PHP and MySQL support
What is a PHP File?

PHP files can contain text, HTML tags and scripts.
PHP files are returned to the browser as plain HTML. 
PHP files have a file extension of ".php", ".php3", or ".phtml".
What is Naming Rules for Variables ?

A variable name must start with a letter or an underscore "_".
A variable name can only contain alpha-numeric characters and underscores
  (a-z, A-Z, 0-9, and _ ) .
A variable name should not contain spaces. If a variable name is more than one word, it   should be separated with an underscore ($my_string), or with capitalization ($myString)
How to Create Function in PHP?

A function will be executed by a call to the function.

function functionName()
  code to be executed;

PHP function guidelines:
Give the function a name that reflects what the function does
The function name can start with a letter or underscore (not a number)

What is an Array ?

A variable is a storage area holding a number or text. The problem is, a variable will hold only one value.
An array is a special variable, which can store multiple values in one single variable.

In PHP, there are three kind of arrays:
Numeric array - An array with a numeric index
Associative array - An array where each ID key is associated with a value
Multidimensional array - An array containing one or more arrays

Which is the Conditional Statement in PHP ?

Very often when you write code, you want to perform different actions for different decisions.
You can use conditional statements in your code to do this.
In PHP we have the following conditional statements:

  • if statement - use this statement to execute some code only if a specified condition is true
  • if...else statement - use this statement to execute some code if a condition is true and another code if the condition is false
  • if...elseif....else statement - use this statement to select one of several blocks of code to be executed
  • switch statement - use this statement to select one of many blocks of code to be executed