Set - 3

Question 11 :

How come the code works, but doesn't for two-dimensional array of mine?

Answer :

Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would've worked.

Question 12 :

How can we register the variables into a session?

Answer :

$_SESSION['var'] = 'value';


Question 13 :

What is the difference between characters \023 and \x23?

Answer :

The first one is octal 23, the second is hex 23.

Question 14 :

With a heredoc syntax, do I get variable substitution inside the heredoc contents?

Answer :


Question 15 :

How can we submit form without a submit button?

Answer :

We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form. For example:

<input type=button value="Save" onClick="document.form.submit()">