M.O.S. Studios Posted August 12, 2011 Share Posted August 12, 2011 Hey guys, I need a function and im hoping that you guys can help me out. I want to feed this function a ini setting and have it return true if was set in php.ini and false if it isn't set or if it was set elsewhere (set_ini for example). Any ideas? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/244613-get_ini/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 12, 2011 Share Posted August 12, 2011 The only built-in method of getting both the local and master settings would be - phpinfo(INFO_CONFIGURATION); You would then need to capture and parse the resulting output to find the setting you are interested in. Edit: Or it looks like you can use ini_get_all Quote Link to comment https://forums.phpfreaks.com/topic/244613-get_ini/#findComment-1256389 Share on other sites More sharing options...
M.O.S. Studios Posted August 12, 2011 Author Share Posted August 12, 2011 this works for me function inphpini($key){ $inivalues = ini_get_all(); return (strlen($inivalues[$key]['global_value']) !== 0) } please note i had to change it to make it make scene on out of contents. may be buggy Quote Link to comment https://forums.phpfreaks.com/topic/244613-get_ini/#findComment-1256477 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.