By helavissa on
Hello,
I have a question (hopefully easy one) - how do I access a php global variable inside a function in Drupal?
For example, following code prints "Hello World", but why in Drupal it doesn't work?
<?php
$test = "Hello World";
function printVar(){
global $test;
echo $test;
}
printVar();
?>
Please help,
Thank you
Comments
that's not a drupal prob :P
try this
that works! Thank you
that works! Thank you