tgallagher26
04-08-2009, 06:04 PM
Ok so I have several functions I have been working all morning to combine.
First to combine my old list with a the new list.
$old_list = 'top100.txt';
$new_list = file_get_contents('http://kywordpro.com/top100print.php');
file_put_contents($old_list, $new_list, FILE_APPEND | LOCK_EX);
Second I want to replace a few items from the updated list
$updated_list = 'top100.txt';
$search = array(' ');
$replace = array('+');
$subject = $updated_list;
$newlyupdated_list = str_replace($search, $replace, $subject);
Then I want to organize my newly updated list
$list = $newlyupdated_list;
$list = array_map("strtolower", $list);
$list = array_unique($list);
sort($list, SORT_STRING);
file_put_contents('perfect_list.txt', implode('', $list));
Can anyone help me get this to work properly?
Tim..
First to combine my old list with a the new list.
$old_list = 'top100.txt';
$new_list = file_get_contents('http://kywordpro.com/top100print.php');
file_put_contents($old_list, $new_list, FILE_APPEND | LOCK_EX);
Second I want to replace a few items from the updated list
$updated_list = 'top100.txt';
$search = array(' ');
$replace = array('+');
$subject = $updated_list;
$newlyupdated_list = str_replace($search, $replace, $subject);
Then I want to organize my newly updated list
$list = $newlyupdated_list;
$list = array_map("strtolower", $list);
$list = array_unique($list);
sort($list, SORT_STRING);
file_put_contents('perfect_list.txt', implode('', $list));
Can anyone help me get this to work properly?
Tim..