This question already has an answer here:
I'm using Php include to minimalize my HTMl code, a somewhat issue I have when doing so is when I include something in PHP with multiple quotations (" and '), for example:
<?php echo '
<div class="section" id="left">
<div class="leftwrappercontent">
<div class="brandname">
<hr>
<p class="leftname"> Aldos Snow</p>
<hr>
<p class="chinese"><img id="namecolor" src="img/name/XDDlvVU.png" alt="My's Chinese Name"><!--張文誠--></p><!--http://en.justfont.com/fontdetail/152-->
<hr class="lasthr">
</div>
<div class="socialstuff">
<a href="" target="_blank"><i class="fa fa-twitter" id="tweet"></i></a>
<a href="" target="_blank"><i class="fa fa-instagram" id="insta"></i></a>
<a href="" target="_blank"><i class="fa fa-pinterest" id="pint"></i></a>
</div>
</div>
</div>
'
?>
If you paste this into a PHP file, you will see that you have to change all the quotations in the middle to be the same so it doesn't conflict with the outer PHP quotations, is there a way around this or do I have to manually change all of them?
</div>
I recommend not echoing HTML, it will avoid problems like you describe - and help with syntax highlighting in your editor
<?php
// some php stuff here
$leftname = 'Aldos Snow';
?>
<div class="section" id="left">
<div class="leftwrappercontent">
<div class="brandname">
<hr>
<p class="leftname"><?= $leftname ?></p>
<hr>
<p class="chinese"><img id="namecolor" src="img/name/XDDlvVU.png" alt="My's Chinese Name"><!--張文誠--></p><!--http://en.justfont.com/fontdetail/152-->
<hr class="lasthr">
</div>
<div class="socialstuff">
<a href="" target="_blank"><i class="fa fa-twitter" id="tweet"></i></a>
<a href="" target="_blank"><i class="fa fa-instagram" id="insta"></i></a>
<a href="" target="_blank"><i class="fa fa-pinterest" id="pint"></i></a>
</div>
</div>
</div>