title: function inside function inside function, Call to undefined function
body: <p>Is this possible in php? I am kind of new and learning. </p>
  
  <pre><code>//file name: functions.php:
  &lt;?php
  function addItem(){
  ...does something
  // calls for another function in the same functions.php file
  randomNumber();
  }
  
  function randomNumber(){
  //generates random number
  }
  
  //////////////////////////////////////
  file name: worker.php
  &lt;?php
  //calls for addItem() function 
  addItem();
  ...
  
  function addItem(){
  //calls for randomNumber() function
  ....
  $itemId = randomNumber();
  .....
  }
  </code></pre>
  
  <p>so i keep getting the error: Call to undefined function randomNumber()
  because i don't include the functions.php file in the addItem() function,
  But if i include it, I keep geting the Cannot redeclare firstFunctionOnFunctionsFile() cus I already declare it. </p>
  
  <p>any ideas? </p>
  
  <p>thanks in advance.  </p>