It seems that when you wish to export a varible, you can do it as return $varible, return an array(), or globalise it. If you return something, information for that varible can only travel one way when the script is running, and that is out of the function. function fn() { $varible = "something"; return $variable; } echo fn(); OR $newvariable = fn(); Although if global was used, it creates a point
