Jump to content

Echo php inside php?


andrew_biggart

Recommended Posts

Is it possible to echo php inside php? Im guessing not because you are already inside php but there must be a way round my problem.

 

What I would like to do is if the url has project = something then echo <?php require "footer.php"; ?> if not dont echo anything.

 

What is the best way to go about doing this ?

Link to comment
https://forums.phpfreaks.com/topic/216870-echo-php-inside-php/
Share on other sites

You don't echo require/include statements anyway, so echo <?php require "footer.php"; ?> doesn't make sense at any time.

 

You just use require "footer.php"; at the point in the php code where you want to require "footer.php". If you want to conditionally do that, you put the require "footer.php"; statement inside of an if(){} conditional statement.

Link to comment
https://forums.phpfreaks.com/topic/216870-echo-php-inside-php/#findComment-1126606
Share on other sites

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.