response->docs); // Search for the application ID in the content element and display it $content = $json->response->docs[$random]->content; preg_match('/Application.*\n(.*)\n/', $content, $application_id); $application_id = json_encode($application_id[1]); $output['application_id'] = $application_id; // Search for the publication ID in the content element and display it $content = $json->response->docs[$random]->content; preg_match('/Publication.*\n(.*)\n/', $content, $publication); $publication_id = json_encode($publication[1]); $output['publication_id'] = $publication_id; // Search for the title in the content element and display it $content = $json->response->docs[$random]->content; preg_match('/Title.*\n(.*)\n/', $content, $title); $title = json_encode($title[1]); $output['title'] = $title; // Search for the abstract in the content element and display it $content = $json->response->docs[$random]->content; preg_match('/Abstract.*\n(.*)\n/', $content, $abstract); $abstract = json_encode($abstract[1]); $output['abstract'] = $abstract; return $output; } ?>