title: simpleXML get node child based on attribute
body: <p>I am trying to parse out the value of a node I am referencing by one of its attributes. but I am not sure of the syntax</p>
  
  <p>XML:</p>
  
  <pre><code>&lt;data&gt;
  
    &lt;poster name="E-Verify" id="everify"&gt;
  
      &lt;full_image url="e-verify-swa-poster.jpg"/&gt;
  
      &lt;full_other url=""/&gt;
  
    &lt;/poster&gt;
  
  
    &lt;poster name="Minimum Wage" id="minwage"&gt;
  
      &lt;full_image url="minwage.jpg"/&gt;
  
      &lt;full_other url="spa_minwage.jpg"/&gt;
  
    &lt;/poster&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>here is where I want to get the url value of full_image where poster id equal to minwage:</p>
  
  <pre><code>$xml = simplexml_load_file('PosterData.xml');
  $main_url = $xml-&gt;full_image[name] where poster[id] = "minwage";
  //something like that.
  echo $main_url;
  
  Result: minwage.jpg
  </code></pre>
  
  <p>If anyone has any resources that cover this stuff please share. </p>