I have a .php file that is rendering as a web page. Is there any way I could change a variable on the fly as the page renders?
Currently the page renders like this...
I love to eat oranges.
I love to eat oranges.
I love to eat oranges.
But I want it to render like this...
I love to eat oranges.
I love to eat apples.
I love to eat cheese.
Please see the sample code below...
<?php
$variable = "oranges";
?>
<?php
echo I love to eat $variable.
?>
<?php
$variable = "apples";
?>
<?php
echo I love to eat $variable.
?>
<?php
$variable = "cheese";
?>
<?php
echo I love to eat $variable.
?>