Code has been added to clipboard!

Global PHP Variables

Example
<?php
  $x = 10;
  $y = 10;

  function learnTest() {
    global $x, $y;
    $y = $x + $y;
  }

  learnTest();
  echo $y; // outputs 20
?>