FramezArt Posted February 25, 2008 Share Posted February 25, 2008 I am somewhat new to PHP coding and i hope this doesnt come off as to basic... for some reason i cant get php code to show up when i put it in a variable: for instance: $var = "<?php echo $title; ?>" $table = "$var" doesnt show any result. when i look at the source on the test site i am working on, it shows that it just writes <?php echo ; ?> in the html but it doesnt run it... is there a solution to this? Thanks! Link to comment https://forums.phpfreaks.com/topic/92986-this-may-be-an-easy-one-to-answer/ Share on other sites More sharing options...
DarkerAngel Posted February 25, 2008 Share Posted February 25, 2008 Oum if your trying to exchange variable data, Just use $var = $title; also, for just a variable to variable you don't need to enclose it in ""'s or you will get something like <?php echo $title; ?> or $var Link to comment https://forums.phpfreaks.com/topic/92986-this-may-be-an-easy-one-to-answer/#findComment-476404 Share on other sites More sharing options...
freenity Posted February 26, 2008 Share Posted February 26, 2008 Wait what do you really want to do?? $var = "<?php echo $title; ?>" // here you put "<?php echo $title; ?>" to $var. You put the string, you dont print $title. You just put this string as it is..... $table = "$var" // here again you put "$var" string to $table. NOT its value. Not sure what you want to do with this. Link to comment https://forums.phpfreaks.com/topic/92986-this-may-be-an-easy-one-to-answer/#findComment-476413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.