- What is the content of $student[1] from the following PHP code?
<?php
// Define the array.
$student = array("1","London","Donovan","3", "Yes","A");
print "The student's id is ".$student[0]."</br>";
print "The student's first name is ".$student[1]."</br>";
print "The student's last name is ".$student[2]."</br>";
print "The student spends ".$student[3]. " hours for this great PHP class.</br>";
print "Does the student has a sense of humor? ".$student[4]."</br>";
print "The student's potential grade is ".$student[5]."</br>";
?>
|
- What is the content of $student[3] from the following PHP code?
<?php
// Define the array.
$student = array("1","London","Donovan","3", "Yes","A");
print "The student's id is ".$student[0]."</br>";
print "The student's first name is ".$student[1]."</br>";
print "The student's last name is ".$student[2]."</br>";
print "The student spends ".$student[3]. " hours for this great PHP class.</br>";
print "Does the student has a sense of humor? ".$student[4]."</br>";
print "The student's potential grade is ".$student[5]."</br>";
?> |
- What is the output from the following PHP code?
<?php
// Define the array.
$student = array("1","London","Donovan","3", "Yes","A");
$output="";
// Read and add array keys and values to a string.
foreach ($student as $hashName => $hashValue)
$output .= $hashValue." ";
// Print the contents only.
print "This row shows the content of the array only. </br> ";
print $output;
?> |
- What is the output from the following PHP code?
<?php
$student = array("1","London","Donovan","3", "Yes","A");
print count($student);
?> |
- What is the output from the following PHP code?
<?php
$student =array("1","London","Donovan","3", "Yes","A");
//$student =3;
if (is_array($student))
{
$output="";
foreach ($student as $hashName => $hashValue)
$output .= $hashValue." ";
print $output;
}
else
{
print "The \$student variable is not an array.";
}
?>
|
- What is the output from the following PHP code?
<?php
//$student =array("1","London","Donovan","3", "Yes","A");
$student =3;
if (is_array($student))
{
$output="";
foreach ($student as $hashName => $hashValue)
$output .= $hashValue." ";
print $output;
}
else
{
print "The \$student variable is not an array.";
}
?>
|
|