Jump to content

Html Table to Three Dimensional Array


thebarman

Recommended Posts

Hi all,

Im currently working on a coding piece that requires me to extract information from four html tables chosen by the User from a website and then merge them into one table for easy viewing, these tables are university lecture timetables for individual subjects. The user provides the subjects he/she is enrolled in and my php code has to return a table with all their subjects in one table bassically merging four tables. My problem is that the preg_match_all funtion doesn't have enough functionality for my liking, i have managed to extract information from the table into the array where it is stored as an array of arrays where the first index is the day and the second is all the subjects for that day, i need to be able to store it so that it is a three dimensional array formatted as follows:

First array is an Array of the days, Second Array is an array of the hours and the third array is each cell corresponing to the matching day and hour.

So basically i need a function that will from a table using regular expressions store it in a three dimensional array formatted as an array of rows that indexes and array of columns that indexes an array of cells if that makes any sense

cheers

-Tristan Cartledge

also a regular expression that would work with preg_match_all() would be great if it worked in this way

thanks

-Tristan
Link to comment
Share on other sites

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.