PHP auto_prepend_file define a constant -


i have configured auto_prepend_file in .htaccess. works fine! wanted know how make string globally without using globals.

i have this:

define('www_url', 'http://www.xyz.de'); define('static_url', 'http://static.xyz.de'); 

how www_url or static_url in index.php loaded right after prepend , before append file?

thanks in advance, daniel

like superglobals, scope of constant global. can access constants anywhere in script without regard scope.

from php manual

so can access constants inside index.php using www_url / static_url.

beware constants read-only: won't able change value after "define()" them, unlike globals variables.


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -