可能重複:
What is the PHP ? : operator called and what does it do?PHP編程語法問題'x? x:x;'
我已經多年PHP編程,但從來沒有明白這個語法確實還是手段。我希望你們可以向我解釋,它的時候,我知道了答案:
list($name, $operator) = (strpos($key, '__')) ? explode('__', $key) : array($key, null);
具體來說,我很好奇的東西嗎?某事:某事;
這是一個條件運算符:http://php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary – 2011-05-03 14:32:40