title: Issue with XML parsing and function in PHP
body: <p>I am trying to play in PHP with XML file.
  It worked quite well up to moment I tried to introduce a function.</p>
  
  <pre><code>$mytournament = simplexml_load_string(utf8_encode(file_get_contents('tournament.xml')));
  
  
  foreach($mytournament-&gt;CLUB as $CLUB){
      foreach ($CLUB-&gt;PERSON as $PERSON){
      echo $PERSON['FIRSTNAME'] . " " . $PERSON['LASTNAME'];
      }
  }
  
  
  function NOM($ARG1){
  foreach($mytournament-&gt;CLUB as $CLUB){
      foreach ($CLUB-&gt;PERSON as $PERSON){
          if ($ARG1 == $PERSON['IDPERS']) {
              echo $PERSON['FIRSTNAME'] . " " . $PERSON['LASTNAME'];
          }
          else {
              echo "unknown name";
          }
      }
  }
  }
  </code></pre>
  
  <p>The first foreach is working well, while, the second into the function is making an error once the function is called. </p>
  
  <blockquote>
    <p>Warning: Invalid argument supplied for foreach() </p>
  </blockquote>
  
  <p>I don't understand how to solve this issue which seems linked to function usage in php (??).</p>
  
  <p>thanks for any hint</p>