Examveda

What will be the output of the following PHP code ?
<?php
echo "This","was"|"a","bad"."idea";
?>

A. Thiswasabadidea

B. Thiswasbadidea

C. Thiswas a badidea

D. Thiswas abadidea

Answer: Option B

Solution (By Examveda Team)

You can use only comma and dot operator to join starings, other characters do not have the same function.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Comments (1)

  1. AMAL M
    AMAL M:
    6 years ago

    I hope option a is correct

Related Questions on Operators and Expressions in php