PHP Questions

PHP Question: Post Variables

29th July 2011

Question

Take the following HTML form.

  1.  

What is the output of the following PHP code after the above form has been submitted, and why?

  1. if ($_POST['number'] === 0) {
  2. echo 'number is zero';
  3. } else {
  4. echo 'number is not zero';
  5. }

PHP Question: Class Methods

4th May 2011

Question

What is the difference between these two lines of code and can you produce the background code used for them?

PHP Question: Form Variables

22nd April 2011

Question

Given the following form:

  1.  

How would you get hold of the value of the input box after the form is submitted?

PHP Question: Pass By Reference

Question

Consider the following:

  1. function doSomething(&$val) {
  2. $val++;
  3. }
  4.  
  5. $a = 1;
  6. doSomething($a);

What does the variable $a now equal?

philipnorton42 Tue, 04/19/2011 - 12:47