<div class="wp-caption alignnone" style="font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; background-color: white; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;"> <div style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">在 PHP 代碼中看到有兩個問號??</span></div> <div style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">兩個問題 ?? 是 PHP7 新推出的表達式。</span></div> <!-- more --> <div style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">A = B ?? C;</span></div> <div style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">表示如果B非空,則A = B,</span>如果B為空,則A = C;</div> <div class="wp-caption-text" style="box-sizing: border-box; margin-bottom: 10px;"> </div> <div class="wp-caption-text" style="box-sizing: border-box; margin-bottom: 10px;"> </div> <div class="wp-caption-text" style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">PHP7</span></div> <div class="wp-caption-text" style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">k = _POST['name'] ?? ' KTV ';</span></div> <div class="wp-caption-text" style="box-sizing: border-box; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">改成PHP5的方法</span></div> </div> <div style="font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; background-color: white; box-sizing: border-box; color: rgb(51, 51, 51); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 10px;"><span style="box-sizing:border-box; vertical-align:inherit">k = issset(_POST['name']) ? _POST['name'] : ' KTV ';</span></div>