strip domain from email addy and write to a text file
i'm looking to strip the domain off an email address like this
open emaillist.txt
eplode @ for each email address
write $doman to newlist.txt (and echo each)
PHP:<?php
$Lines = file("emails.txt");
foreach($Lines as $Key => $Val)
{
$Data[$Key] = explode("@", $Val);
}
for($K = 0; $K < sizeof($Lines); $K++)
{
echo '.'$Data[$K][1]'.';
}
?>
problem is i'm not to great and doing arrays+loops i know how to open a file and write to a file and basic's on loops/arrays.
//edit
just needed to modify this line:
echo '.'$Data[$K][1]'.';
to make it work properly :] didn't bother with having it to write to another file
Last edited by nertman, December 29th, 2006 07:20 AM (Edited 1 times)
