title: calling variables from inner php function to use in outer function
body: <p>currently I have the following code</p>
  
  <p>inside my 'function.php' is</p>
  
  <pre><code>function calcTime($database_name,$currentTime){
  
      global $startTime;
      global $endTime;
  
      ...calcutions
  
      return $startTime;
      return $endTime;
  }//end calcTime()
  </code></pre>
  
  <p>inside my main 'index.php' I have</p>
  
  <pre><code>include('/function.php');
  
  $databaseName = foo;
  
  $currentTime = 12.30;
  
  function begin($database_name,$currentTime){
  
      ...some calculations
  
      calcTime($database_name,$currentTime); //calling the function from other file
  
  echo $startTime;
  
  echo $endTime;
  
  }// end begin()
  </code></pre>
  
  <p>The problem I am having is that the variables that are declared inside the inner function do not pass through to the outer function. I have declared the variables globals and returned them. Not sure whats going on.</p>
  
  <p>something interesting though, if I echo calcTime($database_name,$currentTime); the $startTime is returned but not $endTime. </p>
  
  <p>Please help. I have functions that are used throughout other functions that I would like to use in this fashion. Thank you!!</p>