Page 1 of 1

Simple sintax question

Posted: Tue Aug 23, 2005 6:09 am
by Perfidus
How can I echo the value of

$jhonpeter = 3;

by using the vars:

$p = jhon;
$j = peter;

instead simply:

echo $jhonpeter;

Posted: Tue Aug 23, 2005 6:18 am
by anjanesh
Simple Syntax answer

Code: Select all

$jhonpeter = 3;
$p = "jhon";
$j = "peter";
$c = $p.$j;
echo $$c;