response->docs); //Set content variable $content = $json->response->docs[$random]->content; //Set document reference number (used for OPS API) preg_match('/=D\s(([^\s]*)\s([^\s]*)\s([^\s]*))/', $content, $doc_ref); $output['doc_ref'] = str_replace(' ','',$doc_ref[1]); // Search for the application ID in the content element and display it preg_match('/Application.*\n(.*)\n/', $content, $application_id); $output['application_id'] = $application_id[1]; // Search for the EPO publication URL in the content element and display it preg_match('/Publication.*\n(.*)\n/', $content, $epo_publication); $output['epo_publication_url'] = $epo_publication[1]; // Search for the IPC publication URL in the content element and display it preg_match('/IPC.*\n(.*)\n/', $content, $ipc_publication); $output['ipc_publication_url'] = $ipc_publication[1]; // Search for the title in the content element and display it preg_match('/Title.*\n(.*)\n/', $content, $title); $output['title'] = $title[1]; // Search for the abstract in the content element and display it preg_match('/Abstract.*\n(.*)\n/', $content, $abstract); $output['abstract'] = $abstract[1]; return $output; } ?>