$line) {
//total population
if (preg_match("
", $line)){
$totalPop = cleanTags($lines[$line_num + 1]);
//if invalid zip, census shows "281,421,906"
if(strpos($totalPop, "281,421,906") === false){
$resultsFound = true;
}
//white population
}elseif (preg_match(" | ", $line)){
$totalWhite = cleanTags($lines[$line_num + 1]);
$percentWhite = cleanTags($lines[$line_num + 3]);
$USPercentWhite = cleanTags($lines[$line_num + 5]);
//black / african american population
}elseif (preg_match(" | ", $line)){
$totalBlack = cleanTags($lines[$line_num + 1]);
$percentBlack = cleanTags($lines[$line_num + 3]);
$USPercentBlack = cleanTags($lines[$line_num + 5]);
//american indian / alaska native population
}elseif (preg_match(" | ", $line)){
$totalAmericanIndian = cleanTags($lines[$line_num + 1]);
$percentAmericanIndian = cleanTags($lines[$line_num + 3]);
$USPercentAmericanIndian = cleanTags($lines[$line_num + 5]);
//asian population
}elseif (preg_match(" | ", $line)){
$totalAsian = cleanTags($lines[$line_num + 1]);
$percentAsian = cleanTags($lines[$line_num + 3]);
$USPercentAsian = cleanTags($lines[$line_num + 5]);
//hawaiian population
}elseif (preg_match(" | ", $line)){
$totalHawaiian = cleanTags($lines[$line_num + 1]);
$percentHawaiian = cleanTags($lines[$line_num + 3]);
$USPercentHawaiian = cleanTags($lines[$line_num + 5]);
//Other Race Races population
}elseif (preg_match(" | ", $line)){
$totalOther = cleanTags($lines[$line_num + 1]);
$percentOther = cleanTags($lines[$line_num + 3]);
$USPercentOther = cleanTags($lines[$line_num + 5]);
//2 or More Races population
}elseif (preg_match(" | ", $line)){
$total2More = cleanTags($lines[$line_num + 1]);
$percent2More = cleanTags($lines[$line_num + 3]);
$USPercent2More = cleanTags($lines[$line_num + 5]);
}
}
}
?>
Get Census Data By Zip Code
Race Statistics for Zip Code
Total Population:
 |
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
" title="" width="32" height="" /> |
" title="" width="32" height="" /> |
|
| Race |
Population |
% of Popluation |
% of U.S. Population |
| White |
|
% |
% |
Black or
African American |
|
% |
% |
| American Indian and Alaska Native |
|
% |
% |
| Asian |
|
% |
% |
Native Hawaiian and
Other Pacific Islander |
|
% |
% |
| Some other race |
|
% |
% |
| Two or more races |
|
% |
% |
Source: U.S. Census Bureau
|