Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$a = "hello";
if ($a.length)
    print $a.length;
else
    print "hi";
?>

A. hellolength

B. 5

C. hi

D. error

Answer: Option A

Solution(By Examveda Team)

The . operator appends a string and returns true.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)