Set - 2

Question 11 :

How do I find out the number of parameters passed into function9. ?

Answer :

func_num_args() function returns the number of parameters passed in.


Question 12 :

What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?

Answer :

In MySQL, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.

The '.frm' file stores the table definition.
The data file has a '.MYD' (MYData) extension.
The index file has a '.MYI' (MYIndex) extension


Question 13 :

If the variable $a is equal to 5 and variable $b is equal to character a, what's the value of $$b?

Answer :

100, it's a reference to existing variable.


Question 14 :

How To Protect Special Characters in Query String? 
If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode():

Answer :

print("<html>");
print("<p>Please click the links below"
." to submit comments about TECHPreparation.com:</p>");
$comment = 'I want to say: "It\'s a good site! :->"';
$comment = urlencode($comment);
print("<p>"
."<a href=\"processing_forms.php?name=Guest&comment=$comment\">"
."It's an excellent site!</a></p>");
$comment = 'This visitor said: "It\'s an average site! :-("';
$comment = urlencode($comment);
print("<p>"
.'<a href="processing_forms.php?'.$comment.'">'
."It's an average site.</a></p>");
print("</html>");

 


Question 15 :

Are objects passed by value or by reference?

Answer :

Everything is passed by value.