Przeglądaj źródła

Removed some code for efficiency

main
Simon Bowie 3 lat temu
rodzic
commit
4e77a805d8
1 zmienionych plików z 4 dodań i 8 usunięć
  1. +4
    -8
      site/random.php

+ 4
- 8
site/random.php Wyświetl plik

@@ -28,26 +28,22 @@ function random_record (){
// 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;
$output['application_id'] = $application_id[1];

// Search for the publication URL in the content element and display it
$content = $json->response->docs[$random]->content;
preg_match('/Publication.*\n(.*)\n/', $content, $publication);
$publication_url = json_encode($publication[1]);
$output['publication_url'] = $publication_url;
$output['publication_url'] = $publication[1];

// 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;
$output['title'] = $title[1];

// 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;
$output['abstract'] = $abstract[1];

return $output;


Ładowanie…
Anuluj
Zapisz