What is this ?false:true thing?
Look at this code:
$resolve='whatever you want to put here';
$resolve = (preg_match('/false|no|off/i', $resolve))?false:true;
If I var_dump $resolve after this, and it contains the word "false", "no" and/or "off" I get bool(false) Otherwise I get bool(true). How exactly is it doing that, though? What role does "?false:true" play in this?
I want to know what this is, it looks handy.
Last edited by evenstar7139; 07-25-2012 at 11:37 PM.
The better I get at programming, the more I appreciate arrays. Handy dandy things they are.
PS: Please use with moderation, saving it for simple usages where it's easy to read. For more complex cases, a standard and indented if/else block will make your life easier when maintaining your code in the future.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)