Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $f2=fopen("list2.txt", "r");
- $subs2=Array();
- $summary2=0;
- $f=fopen("list.txt", "r");
- $subs=Array();
- $summary=0;
- echo "<table border=1>";
- while(!FEOF($f2))
- {
- $link2=fgets($f2,10000);
- $cat2=explode(".", $link2);
- $category2=$cat2[0];
- $type="";
- //if(strpos($link2, "model"))
- //{
- // $type2="model";
- // }
- // elseif(strpos($link2, "brand"))
- // {
- // $type2="brand";
- // }
- // elseif(strpos($link2, "tag"))
- // {
- // $type2="tag";
- // }
- // else
- // {
- $type2="category";
- // }
- if(!$subs2[$category2])
- $subs2[$category2]=Array($type2=>1);
- elseif(!$subs2[$category2][$type2])
- $subs2[$category2][$type2]=1;
- else
- $subs2[$category2][$type2]++;
- $summary2++;
- }
- while(!FEOF($f))
- {
- $link=fgets($f,10000);
- $cat=explode(".", $link);
- $category=$cat[0];
- $type="";
- //if(strpos($link, "model"))
- //{
- // $type="model";
- //}
- //elseif(strpos($link, "brand"))
- //{
- // $type="brand";
- //}
- //elseif(strpos($link, "tag"))
- //{
- // $type="tag";
- //}
- //else
- //{
- $type="category";
- //}
- if(!$subs[$category])
- $subs[$category]=Array($type=>1);
- elseif(!$subs[$category][$type])
- $subs[$category][$type]=1;
- else
- $subs[$category][$type]++;
- //echo "<tr><td>$link</td><td>".$cat[0]."</td><td>$type</td></tr>";
- $summary++;
- }
- echo "</table><table border=1>";
- $summary3 = $summary2 + $summary;
- echo "<h2>Summary: $summary3 links</h2>";
- //var_dump($subs2);
- $N=1;
- foreach($subs as $a=>$b)
- {
- $catall = $subs2[trim($a)]["category"] + $b["category"];
- $proc = round($subs2[trim($a)]["category"]/$catall*100);
- // echo "<tr><td>".$a."</td><td>".$b["model"]."</td><td>".$b["brand"]."</td><td>".$b["tag"]."</td><td>".$b["category"]."</td></tr>";
- echo "<tr><td>".$a."1</td><td>".$catall."</td><tr><td>".$a."2</td><td>".$subs2[trim($a)]["category"]."</td></tr><tr><td>".$a."3</td><td>".$b["category"]."</td></tr><tr><td>".$a."4</td><td>".$proc."%</td></tr></tr>";
- $N=1;
- }
- ?>
Add Comment
Please, Sign In to add comment