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 9267087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:28:06+00:00 2026-06-18T14:28:06+00:00

With PHP i’m rendering an HTML table which look somewhat like this: ————————————————– |

  • 0

With PHP i’m rendering an HTML table which look somewhat like this:

--------------------------------------------------
| title    | description         | actions       |
-------------------------------------------------|
| title1   | desc1               | edit / delete |
| title2   | desc2               | edit / delete |
| title3   | desc3               | edit / delete |
| title4   | desc4               | edit / delete |
--------------------------------------------------

The code works like this (stripped down version! no thead, tbody etc. in this examle):

<table>
  <?php foreach ( $tableData as $row ): ?>
  <tr>

    <!-- Render columns (title, description)
    <?php foreach ( $columnData as $column ): ?>
    <td>
      <?= $row[$column['name']]; ?>
    </td>
    <?php endforeach; ?>

    <!-- Render actions -->
    <?php foreach ( $actions as $action ): ?>
    <td>
      <?= include($action); // include the proper action button! ?>
    </td>
    <? endforeach; ?>

  </tr>
  <?php endforeach; ?>
</table>

This gives me the desired result. But I only have one problem with this. It gets kinda slow when I have 1000+ records. I already noticed that this is because i’m doing an include for every table row. When I remove the include then everything runs very fast.

The included file contains some PHP logic. So I can’t just do a file_get_contents. Well, I could, but then I have to use eval() to parse the contents. But i’d rather not use that function at all.

So now i’m wondering if it is possible to cache the included file somehow? So that PHP don’t actively have to include the actual file over and over again but gets it from its cache? Is something like this possible?

Or are there any better alternatives?

  • 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. Editorial Team
    Editorial Team
    2026-06-18T14:28:07+00:00Added an answer on June 18, 2026 at 2:28 pm

    You can put all actions (functions) in one file and include that file once. Just in loop you will call different functions according to their name. Variable function example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
PHP manual suggests to autoload classes like function __autoload($class_name){ require_once(some_dir/.$class_name..php); } and this approach
PHP/HTML Question I hope this is not a dumb question but I am trying
php Code: foreach ($html->find('table') as $noscript) {echo $data; echo $data; echo $noscript->innertext . <br>;
PHP: I have made up a function that returns an array. I would like
PHP experts, I've been working on this problem for about a day and a
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
PHP echo $this->Form->create('Street'); echo $this->Form->input('street', array('empty' => '-- select --', 'label' => '???')); DB

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.