PHP Classes

File: filter_url_list.php

Recommend this page to a friend!
  Classes of Jill Lingoff   Sweeper   filter_url_list.php   Download  
File: filter_url_list.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Sweeper
Clean HTML to remove unwanted tags and attributes
Author: By
Last change:
Date: 5 years ago
Size: 761 bytes
 

Contents

Class file image Download
<?php

//print('...');

$contents = file_get_contents('not-swept/DEC_pages_list.txt');
$array = explode("\r\n", $contents);
//var_dump($array);exit(0);
$filtered_array = array();
foreach(
$array as $index => $value) {
   
preg_match('/[^\?]*/is', $value, $url_matches);
   
/*print($url_matches[0] . '
');*/
   
$add_it = true;
   
$clipped_url = $url_matches[0];
    foreach(
$filtered_array as $index2 => $value2) {
        if(
$clipped_url === $value2[1]) {
           
$add_it = false;
        }
    }
    if(
$add_it) {
       
$whole_url = $value;
       
$filtered_array[] = array($whole_url, $clipped_url);
    }
}
$filtered_contents = '';
foreach(
$filtered_array as $index3 => $value3) {
   
$filtered_contents .= $value3[0] . '
'
;
}
file_put_contents('not-swept/DEC_pages_list_filtered.txt', $filtered_contents)

?>