PHP constants declaration based on condition
        Posted  
        
            by CM
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by CM
        
        
        
        Published on 2010-04-17T17:25:36Z
        Indexed on 
            2010/04/17
            17:33 UTC
        
        
        Read the original article
        Hit count: 229
        
I am using one separate file for all constants of my PHP application.
class constants {
const USERNAME = 'abc';
........
........
}
For lets say USERNAME constant, value can be either xyz or abc based on file exists check. if xyz file exists USERNAME value would be xyz. How can I do this check in my constants class? Thanks in advance.
© Stack Overflow or respective owner