Home » PHP » PHP Introduction » Question
  1. What will be the output of the following PHP code?
    <?php
    $num = 10120;
    $num1 = (array) $num;
    echo $num1[0];
    ?>
    1. 10120
    2. Error
    3. 101
    4. 120
    5. None of these
Correct Option: A

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



Your comments will be displayed only after manual approval.