Jump to content

override script generated table data


funlearner

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

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!

Archived

This topic is now archived and is closed to further replies.

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