Jump to content

override script generated table data


Go to solution Solved by cyberRobot,

Recommended Posts

Hi there,

 

I have a timetable plugin that shows booking entries.

The times are generated dynamically by the plugin.

 

Now I have the situation where I need to override the automatically created time that shows in a table row.

Here's the HTML code generated by the plugin:

 <tr class="row_12">
      <td class="tt_hours_column">00:00</td>

Ist it possible to have a simple PHP script that does the following (please forgive my noobiness) ?

 

if table row is "row_12" then insert "my own pre-defined time"

 

Please don't hate on me, I know I have not the slightest idea about php. I'm just wondering how to solve my plugin problem and if PHP is the right way to do it.

 

I highly appreciate any feedback from you guys :)

Link to comment
https://forums.phpfreaks.com/topic/290284-override-script-generated-table-data/
Share on other sites

  • Solution

You could look into using PHP's DOMDocument class to break apart the HTML:

http://php.net/manual/en/class.domdocument.php

 

Or if the code is simple enough, you may even be able to locate and replace the time information for "row_12" using a PHP function like strpos().

http://php.net/manual/en/function.strpos.php

Thanks cyberRobot!

 

I followed your links and have to admit these examples are way over my head - so the shown code example 'a needle in a haystack' fits perfectly.

I guess I have to find a php-coder who will look into my problem for me.

 

Anyways - thanks a lot for your fast reply!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.