$resume = file("resume.txt"); ?>
<< The Resume of echo $resume[0] ?> >>
$title = 0;
foreach ($resume as $line_num => $line) {
if ($line_num == 0) {
$line = "".$line."
\n";
} else if ($line_num == 2) {
$line = "".$line."
\n";
} else if ($line_num == sizeof($resume)-1) {
$line = "\n".$line."
\n";
} else {
$line = addLinks($line);
if ($title == 1) {
$section = $line;
$line = "\n$line
";
$title = 0;
$li = 1;
}
if ($title >= 1) {
$line = "$line";
$title = 0;
}
if (preg_match ("/___+/",$line)) {
$line = '';
$title = 1;
} else if (preg_match ("/REFERENCES/",$section)) {
$line = '';
} else {
if ((preg_match ("/^\n/",$line))) {
$title = 2;
}
if ($li == 0) {
$line = "".$line."
\n";
} else {
$line = "".$line."\n";
}
}
}
print $line;
}
function addLinks($sentance) {
global $li;
$words = explode(" ", $sentance);
$li = 0;
foreach ($words as $word_num => $word) {
if ($word == '+') {
$words[$word_num] = '';
$li = 1;
} else if (preg_match ("/.*\@.*\..*/",$words[$word_num])) {
$words[$word_num] = ''.$words[$word_num].'';
} else if (preg_match ("/(http:.+)(\).*)/",$words[$word_num],$url)) {
$words[$word_num] = '('.$url[1].''.$url[2];
}
}
return implode(" ",$words);
}
?>