plutomed Posted September 16, 2010 Share Posted September 16, 2010 This is probs. an easy one but I have in my database some values, these values are defined constants in my php code. How do I display the value of the constant not the text (constant name)? Quote Link to comment Share on other sites More sharing options...
joel24 Posted September 16, 2010 Share Posted September 16, 2010 you want to echo the value of a constant...?... but not the name of the constant? define("MyConstant", "testing"); echo "This will echo my constant: " . MyConstant; Quote Link to comment Share on other sites More sharing options...
plutomed Posted September 16, 2010 Author Share Posted September 16, 2010 I just remember constant(); Got it working. Say I had a field in my db that contained FOO. In my php code I had define("FOO", "bar"); What I wanted to do was get the value from the database and echo the constant value. I just put in the code as you would echo from a db normally and it echoed FOO. by putting constant around it, it echoed bar. If that is any better explanation? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.