<?php
//This script is written by Stalin to capture email id from a file
$fd=@fopen("email.txt","r");
if($fd)
echo "File is opened";
else
{
echo "No file is opened";
break;
}
$text=@fread($fd, filesize("email.txt")); //Read the file
$match=preg_split('/@/',$text,-1,PREG_SPLIT_OFFSET_CAPTURE); //split after @
$con = $match[0][0];
echo "<br>";
if (!$match[1][0])
echo "No mail id specified";
else {
$con1=strrev($con);
$match1=preg_split('/ /',$match[1][0],-1,PREG_SPLIT_OFFSET_CAPTURE);
echo "This is domain: ".$match1[0][0];
echo "<br>";
$match2=preg_split('/ /',$con1,-1,PREG_SPLIT_OFFSET_CAPTURE);
$name=$match2[0][0];
$revmatch=strrev($name);
//print_r($match2);
$id = $revmatch."@".$match1[0][0]; //combine the name and domain
echo "This is the email id : $id";
}
@fclose($fd);
?>
email.txt
Some sample sentences with email id within it...This php script will search any directory (and all subdirectories under that directory). It will show you the total size of the directory, number of files in the directory, and identify any files > or = to the size specified. When you run this script you will be prompted for the unix directory name and the test file size parameter. Here i give the mail of us which is somename@somedomain.com is our mail id. :)