Hi guys! Looking at one of the posts (list of cities,state,zip) in this section got me thinking.... is there a similar compilation of colleges/universities in the US?
thanks much!
-Matt
Moderator: General Moderators
interesting little project.... worth it though<LI><A HREF="http://www.au.af.mil/" TARGET="_blank">Air University</A></LI>
<LI><A HREF="http://www.aamu.edu/" TARGET="_blank">Alabama A&M University</A></LI>
<LI><A HREF="http://www.alasu.edu/" TARGET="_blank">Alabama State University</A></LI>
<LI><A HREF="http://www.athens.edu/" TARGET="_blank">Athens State University</A></LI>
<LI><A HREF="http://www.auburn.edu/" TARGET="_blank">Auburn University</A></LI>
<LI><A HREF="http://www.aum.edu/" TARGET="_blank">Auburn University at Montgomery</A></LI>
<LI><A HREF="http://www.bsc.edu/" TARGET="_blank">Birmingham-Southern College</A></LI>
Code: Select all
$file = file_get_contents('sourcefile.txt');
preg_match_all("#<LI>*+? TARGET=\"_blank\">(*+?)</A>#ism",$file,$matches);
foreach($matches[0] AS $match)
{
echo $match.'<br />';
}i tried the following also.... still no luck.Warning: preg_match_all() [function.preg-match-all]: Compilation failed: nothing to repeat at offset 6 in getcolleges.php on line 7
Warning: Invalid argument supplied for foreach() in getcolleges.php on line 9
Code: Select all
<?php
error_reporting(E_ALL);
$file = file_get_contents('sourcefile.html');
preg_match_all("#<LI>*+? TARGET=\"_blank\">,(*+?)</A>#ism",$file,$matches,PREG_PATTERN_ORDER);
foreach($matches[0] AS $match)
{
echo $match.'<br />';
}
?>Code: Select all
$file = file_get_contents('sourcefile.txt');
preg_match_all("#<LI>.+? TARGET=\"_blank\">(.+?)</A>#ism",$file,$matches);
foreach($matches[1] AS $match)
{
echo $match.'<br />';
}