PHP Interview Questions & Answers part 2

Q: – Where do bounced messages go?

Bounces go to whatever address you specify in your From: or Reply-to: mail headers.

Q: – What function sends mail?

mail() function

Q: – Apart from the global keyword, is there any way that a function can access and change global variables?

You can also access global variables anywhere in your scripts with a built-in associative array called $GLOBALS. To access a global variable called $test within a function, you could reference it as $GLOBALS[‘test’]

Q: – What characters can I use to name my tables and fields, and what is the character limit?

The maximum length of database, table, or field names is 64 characters. Any character that you can use in a directory name or file name, you can use in database and table namesexcept / and .. These limitations are in place because MySQL creates directories and files in your file system, which correspond to database and table names. There are no character limitations (besides length) in field names.

Q: – The integer 56678685 could be which datatype(s)?


Q: – Can you include a function call within a string, as you can with a variable?

No. You must call functions outside quotation marks.

Q: – What function call causes the script to execute for as long as it needs to run?


Q: – Which PHP function retrieves the text of a MySQL error message?


Q: – I'm confused by the special variable $this. what is it ?

Within a class, you sometimes need to call the class's methods or access its properties. By combining the $this variable and the -> operator, you can do both. The $this variable is the handle a class is automatically given to refer to itself and to its components.

Submitted By:-Payal Gupta            Email-ID: –