PHP - insert variables into variables.?

What you are doing right now is assigning $author to the $title variable. When you assign it, you are just assigning non declared variable. $author does not exists when it is being assigned to the variable. I hope you understand what I'm trying to say. Anyways here's the fix:

$author = 'H.G. Wells';
$title = 'The War of the Worlds' . $author;

P.S: Also you forgot semicolon (;) at the end of the $author variable.
 
It looks like so,
$title = 'The War of the Worlds' . $author;
$author = 'H.G. Wells';

print $title;

Outcome

The War of the Worlds

How can I insert the variable into the variable?

Thanks in advance..
Much thanks,
I understand, I was calling a variable that wasn't even created yet..
Thanks :]
 
Back
Top