what is the output of the below PHP code: list1 = [123, 'Lee'] print (list1*2)
Answers
Answered by
2
The output is ERROR because Lee is a character and 2 is a number.
Character doesn't multiple with number so the answer will be error
Character doesn't multiple with number so the answer will be error
hasnatmirza111p06f0z:
you are right but you are wrong
Answered by
1
first off all you are crating variable list1 when we create variable in php then we have to define variable with $ or _.second your multiplying string * integer is not possible till you not define that a string is a integer.
fine this code will be:
<?php
$list1 = 123;
print (or) echo ($list1*2)
?>
output:246
fine this code will be:
<?php
$list1 = 123;
print (or) echo ($list1*2)
?>
output:246
Similar questions