What's new

PHP Help

SUNRAI

Eternal Poster
Joined
Feb 1, 2018
Posts
515
Reaction
59
Points
349
Age
23
[CODE title="php"]<?php

$colors = array("red", "green", "white");

echo "The memory of that scene for me is like a frame of film forever frozen at that moment: the" . &colors [0] . "carpet, the" . &colors [1] . "lawn, the" . &colors [2] . "house, the leaden sky. The new president and his first lady. - Richard M. Nixon";

?>[/CODE]
Code:
 
PHP:
<?php

$colors = array("red", "green", "white");

echo("The memory of that scene for me is like a frame of film forever frozen at that moment: the ".$colors[0]." carpet, the ".$colors[1]." lawn, the ".$colors[2]." house, the leaden sky. The new president and his first lady. - Richard M. Nixon");

?>
 
if you are using double quote

no need na putulin mo tas add ng .

like
$var = "variable";
echo "i am ".$var;

pwede mo gamitin yun direcly

echo "i am $var";

or

echo "i am ${var}";
 

Similar threads

Back
Top