Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    <?php
    $string = "Hello Interview Mania. It's a knowledgeable website.";
    print_r (explode(" ",$string));
    ?>
    1. Array
      (
      [0] => Hello
      [1] => Interview
      [2] => Mania.
      [3] => It's
      [4] => a
      [5] => knowledgeable
      [6] => website.
      )
    2. Array
      (
      [0] => Hello
      [1] => Interview
      [2] => Mania.
      )
    3. Hello Interview Mania. It's a knowledgeable website.
    4. Error
    5. None of these
Correct Option: A

The explode() function breaks a string into an array.



Your comments will be displayed only after manual approval.