I was wondering what seems to be more efficient. If I need to use
ThisIsMySuperLongLineOfHTMLCodeThatIsRepeatedManyTimes
a lot in my code, is it more efficient, server wise, to actually set up something like
$repeat = 'ThisIsMySuperLongLineOfHTMLCodeThatIsRepeatedManyTimes'
and then use
<?php echo $repeat; ?>
in it’s place?
The PHP will take longer because it has to run the code and then output it as HTML (using echo.) HTML will just go down the page and display it as many times as it’s used.
EDIT: It looks like you are specifically focusing on the server instead of speed to the user. Other answers are correct that it will be a smaller file size to use the PHP.