Posted by Anonymous on Mon 6 Oct 18:38
report abuse | download | new post
- <pre>
- <?php
- function checktables($html){
- if($tables==$withsummary){
- $withsummary="all";
- }
- echo "I found $tables tables and $withsummary of them have summary atttribute.<br>";
- }
- $file='<table border="4" summary="Hi"></table><table border="7" summary="Hi33443"></table>';
- checktables($file);
- $file='<table border="4"></table><table border="7" summary="Hi33443"></table>';
- checktables($file);
- function checkth($html){
- echo ($thcount==$withabbr) ? "Every th element I found had abbr attribute" : "I found th element with no abbr attibute";
- echo "<br>";
- }
- $file='<table border="4"><tr><th><abbr title="et cetera">etc.</abbr></th></tr></table><table border="7" summary="Hi33443"></table>';
- checkth($file);
- $file='<table border="4"><tr><th><abbr title="et cetera">etc.</abbr></th></tr></table><table border="7" summary="Hi33443"><tr><th>etc.</th></tr><tr><th><abbr title="yes">yeap.</abbr></th></tr></table>';
- checkth($file);
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.