Jump to content

Archived

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

thebarman

Html Table to Three Dimensional Array

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

Share this post


Link to post
Share on other sites

×

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.