";
$toosimple = " ... made up of
";
if ($url != "" && $ptag != "" && $ctag != "") {
echo '
';
echo 'Report regarding ' . $url . ' ...
' . "\n";
$cont = file_get_contents($url);
if (strlen($cont) > 0) {
$cnt = 0;
$report = "";
$startchar = substr($start, 0, 1);
$endchar = str_replace("<", ">", str_replace("[", "]", str_replace("{", "}", str_replace("(", ")", $startchar))));
if (substr($end, 0, 1) == "/") {
$pseudo_end = str_replace("/", "|", str_replace($endchar, "@", $end));
$sparecont = str_replace($pseudo_end, $end, str_replace($endchar, " ", str_replace($end, $pseudo_end, $cont)));
$epll = $end; // likely is "/>"
$epul = $end;
$ecll = $end;
$ecul = $end;
} else {
$sparecont = str_replace($endchar, " ", $cont);
$epll = $end . strtolower($ptag) . $endchar; // likely is something like ""
$epul = $end . strtoupper($ptag) . $endchar;
$ecll = $end . strtolower($ctag) . $endchar;
$ecul = $end . strtoupper($ctag) . $endchar;
}
$spll = $start . strtolower($ptag) . " "; // likely is something like "
Total parent tag
" . str_replace("<", "<", str_replace(">", ">", $spll)) . " found is
" . (sizeof($huhls) - 1) . "";
if ($attrib != "" && (sizeof($huhls) - 1) >= 1) {
$rcnt = 0;
$lcnt = strlen($huhls[0]);
$newspare = $huhls[0];
for ($ij=1; $ij
strlen($spll) && $nextis !== false) {
$snextis = explode($epll, $huhls[$ij]);
$huhls[$ij] = $snextis[0] . substr("@!#$%@#$!@#$%%%%%%;", 0, strlen($epll)) . substr($huhls[$ij], strlen($snextis[0]) + strlen($epll));
}
}
} else {
$newspare .= substr("@!#$%@#$!@#$%%%%%%;", 0, strlen($spll));
$nextis = strpos($huhls[$ij], $epll);
if (strlen($epll) > strlen($spll) && $nextis !== false) {
$snextis = explode($epll, $huhls[$ij]);
$huhls[$ij] = $snextis[0] . substr("@!#$%@#$!@#$%%%%%%;", 0, strlen($epll)) . substr($huhls[$ij], strlen($snextis[0]) + strlen($epll));
}
}
$lcnt += strlen($huhls[$ij]);
$newspare .= $huhls[$ij];
}
$sparecont = $newspare;
echo "
Total relevant (ie. contains " . $attrib . ") parent tag " . str_replace("<", "<", str_replace(">", ">", $spll)) . " found is " . $rcnt . "
";
$huhl = strpos(strtolower($sparecont), $spll);
}
$huhls = explode($scll, strtolower($sparecont));
echo "
Total child tag " . str_replace("<", "<", str_replace(">", ">", $scll)) . " found is " . (sizeof($huhls) - 1) . "
";
$found = 0;
if ($huhl !== false) {
$huhls = explode($spll, strtolower($sparecont));
$newspare = "";
$newspare = $huhls[0];
for ($ij=1; $ij" . str_replace("<", "<", str_replace(">", ">", $scll)) . " ... " . str_replace("<", "<", str_replace(">", ">", $nexta[0])) . "
";
$stuff = explode($scll, $nexta[0]);
if (strpos($makeuplist, ";" . (sizeof($stuff) - 1) . ":") !== false) {
$fi = explode(";" . (sizeof($stuff) - 1) . ":", $makeuplist);
$fin = explode(";", $fi[1]);
$makeuplist = str_replace(";" . (sizeof($stuff) - 1) . ":" . $fin[0] . ";", ";" . (sizeof($stuff) - 1) . ":" . ($fin[0] + 1) . ";", $makeuplist);
} else if (strpos($makeuplist, ":") !== false) {
$toosimple = "youll_neverfindthis";
$makeuplist .= (sizeof($stuff) - 1) . ":1;";
} else {
$makeuplist .= (sizeof($stuff) - 1) . ":1;";
}
if ($toosimple != $suffix) {
$suffix = " ... made up of
" . str_replace(":", " count is ", str_replace(";", "
... Groups of ", substr($makeuplist,0,(strlen($makeuplist) - 1))));
}
$found += (sizeof($stuff) - 1);
}
}
}
echo "
Total child tag " . str_replace("<", "<", str_replace(">", ">", $scll)) . " found within parent tag " . str_replace("<", "<", str_replace(">", ">", $spll)) . " is " . $found . "" . str_replace($toosimple, "", $suffix) . "
";
} else if ($huhu !== false) {
$huhls = explode($spul, strtoupper($sparecont));
echo "
Total parent tag " . str_replace("<", "<", str_replace(">", ">", $spll)) . " found is " . (sizeof($huhls) - 1) . "
";
if ($attrib != "" && (sizeof($huhls) - 1) >= 1) {
$rcnt = 0;
$lcnt = strlen($huhls[0]);
$newspare = $huhls[0];
for ($ij=1; $ij strlen($spul) && $nextis !== false) {
$snextis = explode($epul, $huhls[$ij]);
$huhls[$ij] = $snextis[0] . substr("@!#$%@#$!@#$%%%%%%;", 0, strlen($epul)) . substr($huhls[$ij], strlen($snextis[0]) + strlen($epul));
}
}
} else {
$newspare .= substr("@!#$%@#$!@#$%%%%%%;", 0, strlen($spul));
$nextis = strpos($huhls[$ij], $epul);
if (strlen($epul) > strlen($spul) && $nextis !== false) {
$snextis = explode($epul, $huhls[$ij]);
$huhls[$ij] = $snextis[0] . substr("@!#$%@#$!@#$%%%%%%;", 0, strlen($epul)) . substr($huhls[$ij], strlen($snextis[0]) + strlen($epul));
}
}
$lcnt += strlen($huhls[$ij]);
$newspare .= $huhls[$ij];
}
$sparecont = $newspare;
echo "
Total relevant (ie. contains " . $attrib . ") parent tag " . str_replace("<", "<", str_replace(">", ">", $spll)) . " found is " . $rcnt . "
";
$huhu = strpos(strtoupper($sparecont), $spul);
}
$huhls = explode($scul, strtoupper($sparecont));
echo "
Total child tag " . str_replace("<", "<", str_replace(">", ">", $scll)) . " found is " . (sizeof($huhls) - 1) . "
";
$found = 0;
if ($huhu !== false) {
$huhls = explode($spul, strtoupper($sparecont));
$newspare = "";
$newspare = $huhls[0];
for ($ij=1; $ij" . str_replace("<", "<", str_replace(">", ">", $scul)) . " ... " . str_replace("<", "<", str_replace(">", ">", $nexta[0])) . "
";
$stuff = explode($scul, $nexta[0]);
if (strpos($makeuplist, ";" . (sizeof($stuff) - 1) . ":") !== false) {
$fi = explode(";" . (sizeof($stuff) - 1) . ":", $makeuplist);
$fin = explode(";", $fi[1]);
$makeuplist = str_replace(";" . (sizeof($stuff) - 1) . ":" . $fin[0] . ";", ";" . (sizeof($stuff) - 1) . ":" . ($fin[0] + 1) . ";", $makeuplist);
} else if (strpos($makeuplist, ":") !== false) {
$toosimple = "youll_neverfindthis";
$makeuplist .= (sizeof($stuff) - 1) . ":1;";
} else {
$makeuplist .= (sizeof($stuff) - 1) . ":1;";
}
if ($toosimple != $suffix) {
$suffix = " ... made up of
" . str_replace(":", " count is ", str_replace(";", "
... Groups of ", substr($makeuplist,0,(strlen($makeuplist) - 1))));
}
$found += (sizeof($stuff) - 1);
}
}
}
echo "
Total child tag " . str_replace("<", "<", str_replace(">", ">", $scll)) . " found within parent tag " . str_replace("<", "<", str_replace(">", ">", $spll)) . " is " . $found . "" . str_replace($toosimple, "", $suffix) . "
";
}
}
echo '
' . "\n";
echo '