1E_Test

false, 'endpoint_variables' => array(), 'body_variables' => array()) ); $results = count($response_data); $array_count = $results -1; /* echo "Number of data sets: " .$results. "
"; echo "Array count: " .$array_count. "
"; echo "Animal name: " . $response_data[0]['ANIMALNAME']."
"; */ // Create the table echo ''; echo ''; // Loop through the Json array results to display the animals limiting to only 5 per row for ($i = 0; $i<=$array_count; $i++) { $name = preg_replace('/[^A-Za-z0-9\-]|[0-9]|\bof\b|\bon\b|more|\bblk\b|\bback\b/', ' ', $response_data[$i]['ANIMALNAME']); $age = $response_data[$i]['ANIMALAGE']; $str = preg_replace('/\s{2,}/', ' ', $age); $breed = $response_data[$i]['BREEDNAME1']; $sheltercode = $response_data[$i]['SHELTERCODE']; $sex = $response_data[$i]['SEXNAME']; $species = $response_data[$i]['SPECIESNAME']; $profile_page = "https://macsshelter.org/pet-profile?id="; $image = "https://service.sheltermanager.com/asmservice?account=tw1454&method=media_image&mediaid="; // Populate pet profile for each that are in the Json API data set ($i) echo ''; $n++; // If there is a full row of 5 pets($n) in the row, start a new row. if($n == 5||$n == 10||$n == 15||$n == 20||$n == 25||$n == 30||$n == 35 ||$n == 40 ||$n == 45 ||$n == 50||$n == 55||$n == 60) { echo ''; echo ''; } } // If there is less then a full row, check to see how many are in the row and add some empty placeholders to keep the row formatting. switch ($n) { case 1: echo ''; break; case 2: echo ''; break; case 3: echo ''; break; case 4: echo ''; break; } // Finish the last row if it has less then 5 pets in it. if ($i <> 5 || $i <> 10 || $i <> 15 || $i <> 20 || $i <> 25 || $i <> 30 || $i <> 35 || $i <> 40 || $i <> 45 || $i <> 50 || $i <> 55 ||$i <> 60){ echo ''; } echo '
'; echo '
'; echo '

'.$name.'

'; echo ''; echo '

'.$sex.' ' .$species. '
' .$breed. '
' .$age . '

'; echo '
'; echo '
'; ?>