Page 1 of 1

echo a variable inside a varibale?

Posted: Sat Feb 18, 2006 6:40 pm
by jasondavis
Ok Im making a small script for an FAQ section on my site
basicly this is my code that displays my Answers on my page from a mysql DB

Code: Select all

" . $row['answer'] . "

when I add new entries in the DB to be showed sometimes I need to display some php code for instance I tried this and it just acts like it isnt there when I view my page

Code: Select all

<?echo=$users_in_train;?>

Posted: Sat Feb 18, 2006 6:42 pm
by hawleyjr
Try:

Code: Select all

<?php echo $users_in_train; ?>

Posted: Sat Feb 18, 2006 8:52 pm
by s.dot
if you want to use the echo shortcut, do this

Code: Select all

<?=$var; ?>
But your php settings must allow short tags to be used because I don't think <?php=$var; ?> works.