<html> <head> <title>Local Variable Unavailable Outside a Function</title> </head> <body> <div> <?php function test() { $testvariable = "this is a test variable"; } print "test variable: $testvariable<br/>"; ?> </div> </body> </html>