Sail E0 Webinar
Question
What will be the output of the following PHP code?
< ?php
$score = 1234;
$scoreboard = (array) $score;
echo $scoreboard[0];
?>
Options:
A .  1
B .  Error
C .  1234
D .  2
Answer: Option C


The (array) is a cast operator which is used for converting values from other data types to array.



Was this answer helpful ?

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers