Jump to content

include help


zang8027

Recommended Posts

I want to put this into an include but.. as you can see, it uses both ' and " so i dont know how to do this.         

<div id="footer">
<div class="sub-nav">
<a href="index.php" onmouseover="roll('sub_but', 'images/sub-home-btn-over.png')" onmouseout="roll('sub_but', 'images/sub-home-btn.png')"><img src="images/sub-home-btn.png" alt="home" name="sub_but"/></a>

             

 

 

So i cant really do:

 

<?php
echo'
<div id="footer">
<div class="sub-nav">
<a href="index.php" onmouseover="roll('sub_but', 'images/sub-home-btn-over.png')" onmouseout="roll('sub_but', 'images/sub-home-btn.png')"><img src="images/sub-home-btn.png" alt="home" name="sub_but"/></a>

';
?>

 

Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/187734-include-help/
Share on other sites

If you are saying that is going to be in an include file you can just put the HTML in the file it doesn't need to be echo'd. Alternatively you can use the heredoc syntax.

 

$example = <<<HTML
<div id="footer">
   <div class="sub-nav">
   <a href="index.php" onmouseover="roll('sub_but', 'images/sub-home-btn-over.png')" onmouseout="roll('sub_but', 'images/sub-home-btn.png')"><img src="images/sub-home-btn.png" alt="home" name="sub_but"/></a>
HTML;

echo $example;

Link to comment
https://forums.phpfreaks.com/topic/187734-include-help/#findComment-991159
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.