Description: Helpful for debugging bad HTML code.
This program counts the number of opening table tags and how many imbedded tables exist.
Html table tag analysis: 1.0.0: This program counts the number
of opening table tags and how
many imbedded tables exist.
Copyright (C) 2000 Jeremy Brand
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
if ($argc < 2)
print "argv should be the name of the file you want to parse.\n";
print "Argv can be a valid URL\n";
$array = file($argv);
$array_size = count($array);
$max = 0;
$deep = 0;
$num_tables = 0;
$close = 0;
while(list($key, $val) = each($array))
if ($deep > $max)
$max = $deep;
else if (eregi('</table',$val))
print "The total number of open table tags is $num_tables\n";
print "The total number of close table tags is $close\n";
if ($close != $num_tables)
print "Warning: The number of open table tags does not equal the number of close tables tags. Make sure you check your code!\n\n";
print "The max depth of imbeded tables is $max\n";