Generating multiple NCBI URLs with eutils
I don't know anything about php, but when I copy your code into here it isn't happy about the variable name $query.

This code appears to produce valid urls, but I can't make the get part work:

$eutils = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils"; $db = "gene";$gene_symbols = array("A20","HBB","ABO");
$species = array("homo sapiens", "Escherichia coli","Saccharomyces cerevisiae"); $links = array();

foreach ($gene_symbols as $key =&gt; $GS){ 
   $SP = $species[$key];
   $SearchTerm = "$GS AND $SP [orgn] AND alive";

   $esearch = "$eutils/esearch.fcgi?db=$db&amp;retmode=xml&amp;retmax=10&amp;sort=relevance&amp;term=";

   echo $esearch.$SearchTerm;
}

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&amp;retmode=xml&amp;retmax=10&amp;sort=relevance&amp;term=A20 AND homo sapiens [orgn] AND alivehttp://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&amp;retmode=xml&amp;retmax=10&amp;sort=relevance&amp;term=HBB AND Escherichia coli [orgn] AND alivehttp://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&amp;retmode=xml&amp;retmax=10&amp;sort=relevance&amp;term=ABO AND Saccharomyces cerevisiae [orgn] AND alive