How to Use Global Variable?
I have the following at the top of functions.php:`<?php global $callername; ?>
`I then have a function that sets $callername, and another that gets its current value. But whereas the ‘set’ function works (it printf’s $callername after setting), the get function then reports null. Do I misunderstand how global works or have I placed it wrongly?
- The topic ‘How to Use Global Variable?’ is closed to new replies.