title: Call function from within another function
body: <p>I'm trying to call a function from within another function, and use the returned variable.</p>
  
  <pre><code>function getUserEmail($clean_useremail){
      // Get the POST var
      if ($_SERVER["REQUEST_METHOD"] == "POST") {
           $useremail = test_input($_POST["useremail"]);
      }
      // Santize
      $clean_useremail = filter_var($useremail), FILTER_SANITIZE_EMAIL);
  
      if isset($clean_useremail){
          return $clean_useremail;
          // here is where I want to run createXML() using $clean_useremail
      }else{
          echo 'Error, no email received from form.';
      }
  }
  
  function createXML(){
      // create xml
  }
  </code></pre>
  
  <p>The first function <code>getUserEmail()</code> is called when a form is submitted via POST. It should get the data from the form, sanitize it and store it.</p>
  
  <p>The function <code>createXML()</code> I want to run afterwards, and make use of the variable <code>$clean_useremail</code></p>