Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 128055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:34:28+00:00 2026-05-11T05:34:28+00:00

In terms of performance , what would be better. Using PHP to echo all

  • 0

In terms of performance , what would be better. Using PHP to echo all the HTML output so I can pepper it with the various bits of working code and variables or escape HTML to php periodically throughout the documents.

I know there may be some readability issues but I’m not to worried about that.

Thanks all!

Example 1

echo '<html>',      '<body>',      'The content of the ',$container,' element is displayed in your ', $other_container,      '</body>',      '</html>'; 

OR

<html> <body> The content of the <?php echo $container; ?> element is displayed in your <?php echo $other_container; ?> </body> </html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:34:29+00:00Added an answer on May 11, 2026 at 5:34 am

    It’s all about which you find the most readable. Of course, this will vary with each situation. If you were doing an entire page, and there were large sections which did not have any PHP in it, then I’d break out of PHP and just write the plain HTML, whereas if there was a section which had a lot of PHP variables, I’d do it all in PHP.

    For example:

    <table>     <tr>         <td colspan='<?php echo $numCols; ?>'>             <?php echo $a; ?>, <?php echo $b; ?>, and <?php echo $c?>         </td>     </tr> </table> 

    versus:

    <?php echo '<table>'     . '<tr>'     .    '<td colspan=\'' . $numCols . '\'>'     .        $a . ', ' . $b . ' and ' . $c     .    '</td>'     . '</tr>'     . '</table>' ; ?> 

    Or

    <?php echo '<table>          <tr>             <td colspan='{$numCols}'>                {$a}, {$b}, and {$c}             </td>          </tr>       </table>'; ?> 

    Also don’t forget about printf

    <?php printf('<table>'     . '<tr>'     .    '<td colspan=\'%d\'>%s, %s and %s</td>'     . '</tr>'     . '</table>'     , $numCols     , $a     , $b     , $c ); ?> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using groovy, would you expect better performance in terms of speed and memory overhead
In terms of performance and efficiency, is it better to use lots of small
What would be faster in terms of performance and usability of editing etc. Storing
What is the difference between MySQL unique and non-unique index in terms of performance?
The terms are used all over the place, and I don't know of crisp
Since debate without meaningful terms is meaningless , I figured I would point at
Here is my stack implementation with linked list. The program is working correctly. Would
I'm currently trying to find the best way (in term of usability and performance)
In terms of quick dynamically typed languages, I'm really starting to like Javascript, as
In terms of general operating system concepts, what is the difference between a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.