isset PHP isset($_GET['something']) ? $_GET['something'] : ''

前端 未结 8 1432
清酒与你
清酒与你 2020-12-13 04:02

I am looking to expand on my PHP knowledge, and I came across something I am not sure what it is or how to even search for it. I am looking at php.net isset code, and I see

8条回答
  •  眼角桃花
    2020-12-13 04:39

    It is called the ternary operator. It is shorthand for an if-else block. See here for an example http://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary

提交回复
热议问题