Download the PHP package csskevin/tabledude without Composer
On this page you can find all versions of the php package csskevin/tabledude. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download csskevin/tabledude
More information about csskevin/tabledude
Files in csskevin/tabledude
Package tabledude
Short Description Helps you processing HTML Tables with PHP to save them for instance as associative arrays.
License MIT
Informations about the package tabledude
TableDude
TableDude parses, converts and analyses HTML Tables. This software is written in plain PHP without any external libraries (except PHPUnit for testing).
Compatibility
You can use this software for PHP version >= 7
It might work with older versions, but I haven't tested it.
Quick Start
To install this software you can either use composer or install it manually.
Composer way
composer require csskevin/tabledude
Manual way
git clone https://github.com/csskevin/TableDude.git
Examples
You can also identify table headers by getting their fingerprint.
Testing
This software was tested with PHPUnit. The composer.json
includes a test script.
composer install
composer run-script test
Documentation
There are four main components:
- Parser (This parses HTML Tables to PHP Arrays)
- Converter (Let's you convert and group PHP Arrays)
- Analysis (Analyzes a table)
- Tools (Some tools to modify the tables)
Parser
\TableDude\Parser\SimpleParser
Converter
There are three different converter:
- HorizontalTable
- VerticalTable
- MixedTable
\TableDude\Converter\HorizontalTable
This table converts out of a simple parsed HTML table, an associative array where the keys equals a defined header row.
The methods will be documented in the example below
\TableDude\Converter\VerticalTable
This table converts out of a simple parsed HTML table, an associative array where the keys equals a defined header column.
The methods will be documented in the example below
\TableDude\Converter\MixedTable
This table converts out of a simple parsed HTML table, an associative array where the keys equals a defined header row and header column.
The methods will be documented in the example below
Tools
\TableDude\Tools\ArrayTool
public static function swapArray($array);
Swaps an array
public static function countLongestRowOfArrayTable($array);
Returns the length of the longest row
public static function validateVerticalTable($table);
Validates, wheter a vertical table is valid.
public static function validateHorizontalTable($table);
Validates, wheter a horizontal table is valid.
public static function validateMixedTable($table);
Validates, wheter a mixed table is valid.
Analysis
\TableDude\Analysis\HeaderAnalyzation
public static function getFingerPrintOfArray($array)
Returns a fingerprint of the array. This is very useful for identifying tables by the header.