There is a clear pattern as to what the number values would be. And this has a starting interval and known start and end value. Though the end may change, it seems simpler to set the values and do some magical loop. Any better formats would be appreciated. The sets are what I would have gone with if I could have gotten the loop to work correctly.
<?php
$setStart =5000;
$setEnd = 95000;
$setInterval = 5000;
//Enter your code here, enjoy!
foreach($zips as $zipcode) {
$zip = $zipcode['zip'];
$zipInt = intval($zipcode['zip']);
$org_ids = $zipcode['orgs'];
$org_ids = explode(",",$org_ids);
if (!empty($org_ids)) {
if ($zipInt < 5000) {
$zips00_array[$zip] = $org_ids;
}
if ($zipInt >= 5000 && $zipInt < 10000) {
$zips05_array[$zip] = $org_ids;
}
if ($zipInt >= 10000 && $zipInt < 15000) {
$zips10_array[$zip] = $org_ids;
}
if ($zipInt >= 15000 && $zipInt < 20000) {
$zips15_array[$zip] = $org_ids;
}
if ($zipInt >= 20000 && $zipInt < 25000) {
$zips20_array[$zip] = $org_ids;
}
if ($zipInt >= 25000 && $zipInt< 30000) {
$zips25_array[$zip] = $org_ids;
}
if ($zipInt >= 30000 && $zipInt < 35000) {
$zips30_array[$zip] = $org_ids;
}
if ($zipInt >= 35000 && $zipInt < 40000) {
$zips35_array[$zip] = $org_ids;
}
if ($zipInt >= 40000 && $zipInt < 45000) {
$zips40_array[$zip] = $org_ids;
}
if ($zipInt >= 45000 && $zipInt < 50000) {
$zips45_array[$zip] = $org_ids;
}
if ($zipInt >= 50000 && $zipInt < 55000) {
$zips50_array[$zip] = $org_ids;
}
if ($zipInt >= 55000 && $zipInt < 60000) {
$zips55_array[$zip] = $org_ids;
}
if ($zipInt >= 60000 && $zipInt < 65000) {
$zips60_array[$zip] = $org_ids;
}
if ($zipInt >= 65000 && $zipInt < 70000) {
$zips65_array[$zip] = $org_ids;
}
if ($zipInt >= 70000 && $zipInt < 75000) {
$zips70_array[$zip] = $org_ids;
}
if ($zipInt >= 75000 && $zipInt < 80000) {
$zips75_array[$zip] = $org_ids;
}
if ($zipInt >= 80000 && $zipInt < 85000) {
$zips80_array[$zip] = $org_ids;
}
if ($zipInt >= 85000 && $zipInt < 90000) {
$zips85_array[$zip] = $org_ids;
}
if ($zipInt >= 90000 && $zipInt < 95000) {
$zips90_array[$zip] = $org_ids;
}
if ($zipInt >= 95000) {
$zips95_array[$zip] = $org_ids;
}
}
}
zips
so that the code is runnable? (I'm new here) \$\endgroup\$