thenature4u Posted May 7, 2008 Share Posted May 7, 2008 <?php $b='abc'; // dynamic echo $b; // output is abc ?> by using this $b i have to get the value of 'abc' from common.inc.php common.inc.php <?php define('abc','hello'); ?> if any solution please let me know............. Quote Link to comment https://forums.phpfreaks.com/topic/104549-help-needed/ Share on other sites More sharing options...
thenature4u Posted May 7, 2008 Author Share Posted May 7, 2008 <?php echo $b; // output is abc ?> by using this $b i have to get the value of 'abc' from common.inc.php common.inc.php <?php define('abc','hello'); ?> if any solution please let me know............. Quote Link to comment https://forums.phpfreaks.com/topic/104549-help-needed/#findComment-535159 Share on other sites More sharing options...
conker87 Posted May 7, 2008 Share Posted May 7, 2008 common.inc.php <?php define("ABC", "hello") ?> other.php <?php $b = ABC; echo $b. ?> Quote Link to comment https://forums.phpfreaks.com/topic/104549-help-needed/#findComment-535162 Share on other sites More sharing options...
ToonMariner Posted May 7, 2008 Share Posted May 7, 2008 constants are constants so you can't reference them as variables... constants are defined (hence the define construct) and as such should not need to be 'found' - they will already be there... to grab all constants set use print_r(get_defined_constants()); Quote Link to comment https://forums.phpfreaks.com/topic/104549-help-needed/#findComment-535176 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.