Examveda
Examveda

What will be the output of the following PHP code?
<?php
$score = 1234;
$scoreboard = (array) $score;
echo $scoreboard[0];
?>

A. 1

B. Error

C. 1234

D. 2

Answer: Option C

Solution(By Examveda Team)

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

This Question Belongs to PHP >> Basic PHP

Join The Discussion

Related Questions on Basic PHP