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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.