Jump to content

This may be an easy one to answer...


FramezArt

Recommended Posts

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

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.