Speedysnail6

Untitled

Jun 6th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. 2nd file:
  2. <?php
  3. $test = array();
  4. function sup() {
  5.     global $test;
  6.     array_push($test, "0");
  7. }
  8. //So it wont say 0 because i didnt call sup() yet until the other page which is after the include once
  9. echo $test[0];
  10.  
  11. 1st File:
  12.  
  13. <?php
  14. require_once('test.php');
  15. sup();
  16. //now it will say 0
  17. echo $test[0];
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment