Q: What’s the special meaning of __sleep and __wakeup? -
Ans: __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
Q: Why doesn’t the following code print the newline properly?
$str = ‘Hello, there.nHow are you?nThanks for visiting TechInterviews’;
print $str;
?>
Ans: Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.
PHP, MYSQL, JOOMLA, JQUERY, DRUPAL, AJAX, HTML, CSS, PHOTOSHOP, .NET, ASP.NET, VB.NET, C#, SHAREPOINT, C, C++, VB, JAVA, JAVASCRIPT, DOJO
Thursday, June 17, 2010
PHP - Interview questions - V
PHP - Interview questions - V
Q: Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
Ans: In this example, 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.
Q; If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?
ns: 100, it’s a reference to existing variable.
Q: Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
Ans: In this example, 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.
Q; If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?
ns: 100, it’s a reference to existing variable.
Monday, June 7, 2010
PHP - Interview questions - IV
Q. What is the difference between mysql_fetch_object and mysql_fetch_array?
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:
If you change the line: short_open_tag = off in php.ini file.
Then your php engine support only mode.
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.
Q. Suppose your Application using the mode Then how can u configure php engine to support mode ?
Answer:
If you change the line: short_open_tag = off in php.ini file.
Then your php engine support only mode.
PHP - Interview questions - III
Q. Who is the father of php?
Answer:
Rasmus Lerdorf is the father of PHP.
Marco Tabini is the founder and publisher of php|architect.
Q. What is the difference between $message and $$message?
Answer:
They are both variables.
But $message is a variable with a fixed name.
$$message is a variable who's name is stored in $message.
Ex::
$message = "var";
$$message = $var;
Answer:
Rasmus Lerdorf is the father of PHP.
Marco Tabini is the founder and publisher of php|architect.
Q. What is the difference between $message and $$message?
Answer:
They are both variables.
But $message is a variable with a fixed name.
$$message is a variable who's name is stored in $message.
Ex::
$message = "var";
$$message = $var;
PHP - Interview questions - II
Q. What are the differences between GET and POST methods ?
Answer:
1. On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
2. On the browser side, the difference is that data submitted by the GET method will be displayed in the browser's address field. Data submitted by the POST method will not be displayed anywhere on the browser.
3. GET method is mostly used for submitting a small amount and less sensitive data. POST method is mostly used for submitting a large amount or sensitive data.
Q. How can we submit from without a submit button?
Answer:
Using JavaScript code linked to an event trigger of any form field.
In JavaScript code, the document.form.submit() function to submit
the form.
Answer:
1. On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
2. On the browser side, the difference is that data submitted by the GET method will be displayed in the browser's address field. Data submitted by the POST method will not be displayed anywhere on the browser.
3. GET method is mostly used for submitting a small amount and less sensitive data. POST method is mostly used for submitting a large amount or sensitive data.
Q. How can we submit from without a submit button?
Answer:
Using JavaScript code linked to an event trigger of any form field.
In JavaScript code, the document.form.submit() function to submit
the form.
Monday, May 31, 2010
PHP - Interview questions
1. What does a special set of tags do in PHP?
Ans: The output is displayed directly to the browser.
2. What’s the difference between include and require?
Ans: It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
Ans: The output is displayed directly to the browser.
2. What’s the difference between include and require?
Ans: It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
Subscribe to:
Posts (Atom)