Question: With a file opened in read mode, which command can you use to read in a string of up to a maximum of 100 characters,
With a file opened in read mode, which command can you use to read in a string of up to a maximum of 100 characters, or the next newline or file end (whichever comes first)?
Question 1 options:
|
|
$string = fgets($handle, 101);
|
|
|
$string = fputs($handle, 101);
|
|
|
$string = fread($handle, 101);
|
|
|
$string = fhandle($handle, 101);
|
|
|
None of the above
|
Question 5 (0.4 points)
Saved
In PHP, how can you assign default values to arguments that are passed to a function?
Question 5 options:
|
|
Assign the default value to the variable before the function declaration.
|
|
|
Assign the default value to the variable before calling the function.
|
|
|
Assign the default value to the variable within the function parentheses.
|
|
|
Assign the default value to the variable inside the function implementation.
|
|
|
Assign the default value to the variable after calling the function.
|
Question 7 (0.4 points)
In PHP, with which array can you access global variables from a function?
Question 7 options:
|
|
Using $GLOBALS[] array
|
|
|
Using $_GLOBALS[] array
|
|
|
Using $GLOBAL[] array
|
|
|
Using $_GLOBAL[] array
|
|
|
None of the above
|
Question 10 (0.4 points)
How can you test whether two values evaluate to the same result and are both of the same type?
Question 10 options:
|
|
Using the = operator
|
|
|
Using the == operator
|
|
|
Using the === operator
|
|
|
Using the ==== operator
|
|
|
Using isEqual() function
|
Question 12 (0.4 points)
Which valid attributes can be added to the form tag.
Question 12 options:
|
|
type, value
|
|
|
id, value
|
|
|
autocomplete, name
|
|
|
method, type
|
|
|
action, type
|
Question 14 (0.4 points)
Which ones are valid DOM events?
Question 14 options:
|
|
ondoubleclick
|
|
|
doubleclick
|
|
|
mousedown
|
|
|
mouseup
|
|
|
onchange
|
Question 22 (0.4 points)
How can you access form data sent to PHP via a Post request?
Question 22 options:
|
|
if (isset($POST['mykey'])) $mykey = $POST['mykey'];
|
|
|
if (_isset($_POST['mykey'])) $mykey = $_POST['mykey'];
|
|
|
if (isset(POST['mykey'])) mykey = POST['mykey'];
|
|
|
if (isset($_POST['mykey'])) $mykey = $_POST['mykey'];
|
|
|
if (isset($POST['mykey'])) $mykey == $POST['mykey'];
|
Question 24 (0.4 points)
In light of the difference between a Post and a Get request, which statement is false?
Question 24 options:
|
|
A Post request sends form data to a program in the form of headers
|
|
|
A Get request sends data in the form of a query string
|
|
|
Data sent through a Get is attached to the tail of the requested URL
|
|
|
Data sent through a Post is encrypted within the requested URL
|
|
|
Both Get and Post method is used for client-server communication
|
Which of the following indicates the end of a multiple-line JavaScript comment?
Question 28 options:
|
|
\\
|
|
|
-->
|
|
|
/*
|
|
|
*/
|
|
|
<--
|
Question 30 (0.4 points)
Which of the following correctly codes an alert on the click event?
Question 30 options:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Question 36 (0.4 points)
colspan="3" would be used to format the first row as seen in the image bellow:
Question 36 options:
| True | |
| False |
Question 41 (0.4 points)
In PHP, how can you read in a web document or object from a URL?
Question 41 options:
|
|
file_get_content()
|
|
|
file_put_content()
|
|
|
file_read_content()
|
|
|
file_url_content()
|
|
|
None of the above
|
Question 44 (0.4 points)
In PHP, what is the recommended way to create a constructor method for a class?
Question 44 options:
|
|
function _construct($arg1, $arg2) { }.
|
|
|
function construct($arg1, $arg2) { }.
|
|
|
function constructor($arg1, $arg2) { }.
|
|
|
function _constructor($arg1, $arg2) { }.
|
|
|
function __construct($arg1, $arg2) { }.
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
