Multi-Disciplinary Databases

"; $i = 0; foreach($databases as $database) { if($i > 0) { //title $title_raw = explode('"title":', $database); $title = explode(',', $title_raw[1]); $title[0] = str_replace('"', '', $title[0]); $title_clean = str_replace('[', '', $title[0]); $title_clean = str_replace(']', '', $title_clean); $title_clean = str_replace('(', '', $title_clean); $title_clean = str_replace(')', '', $title_clean); $title_clean = str_replace(' ', '', $title_clean); $title_clean = str_replace('-', '', $title_clean); $title_clean = "multi_" . $title_clean; //description $desc_raw = explode('"description":', $database); $desc = explode('",', $desc_raw[1]); //short description $short_raw = explode('"lds17":', $database); $short = explode('},', $short_raw[1]); $short[0] = str_replace('"', '', $short[0]); //provider $prov_raw = explode('"lds10":', $database); $prov = explode(',', $prov_raw[1]); //format $format_raw = explode('"lds12":', $database); $format = explode(',', $format_raw[1]); //subjects $sub_raw = explode('"subject":', $database); $sub = explode(',', $sub_raw[1]); //URL $tmp_raw = explode('"lln01":', $database); $tmp = explode(',', $tmp_raw[1]); $tmp[0] = str_replace('"', '', $tmp[0]); $tmp[0] = str_replace('[', '', $tmp[0]); $tmp[0] = str_replace(']', '', $tmp[0]); $tmp[0] = str_replace('}', '', $tmp[0]); $tmp[0] = str_replace('$$U', '', $tmp[0]); $desc[0] = str_replace('"', '', $desc[0]); $prov[0] = str_replace('"', '', $prov[0]); $sub[0] = str_replace('"', '', $sub[0]); //$output .= ""; } $i++; } $output .= "
$i"; $output .= "
"; $output .= "

" . $title[0] . "

"; $output .= "
" . $short[0] . "
"; $output .= "
About this resource:
" . $desc[0] . "

"; // $output .= "
Format:
" . $format[0] . "
"; $output .= "
Provider:
" . $prov[0] . "

"; $output .= "
This resource covers the following topics:
" . $sub[0] . "

"; $output .= ""; $output .= "

"; echo $output; curl_close($ch); $file = fopen("multi.html", "w") or die("Unable to open file!"); fwrite($file, $output); fclose($file); ?>