Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php global variable function

<?php
  $myVariable = "a";
  function changeVar($newVar) {
    global $myVariable
    $myVariable = "b";
  }
  echo $myVariable; // Should echo b
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #global #variable #function
ADD COMMENT
Topic
Name
7+5 =