Why is PHP not replacing the variable in string? [closed]

That is because you need to use double quote instead.
php will not convert variables to their values when surrounded by single quotes

<?php
$someVariable = 0;
echo "SomeVariable is $someVariable";
?>

Leave a Comment