Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
Why get error ?
<?php $str = "10" $int = 20; $sum = "$str + $int"> echo ($sum); ?>
3 Answers
+ 3
Make following changes
<?php
$str = "10"; //Missed semi-colon
$int = 20;
$sum = "$str + $int"; //1. another typo > instead of ;
//2. will result into 10 + 20. Remove quotes to get actual sum
echo ($sum);
?>
+ 2
<?php
$str = "10";
$int = 20;
$sum = "$str + $int";
echo ($sum);
?>
+ 1
thanks I got it .