Is there an “automatic-null” operator for undefined index on an array in PHP?

前端 未结 0 1065
后悔当初
后悔当初 2020-11-28 05:34

I\'ve been finding that I\'m writing a lot of code like this:

$customData1 = $user[\'custom_data_1\'] ?? null;
$customData2 = $user[\'custom_data_2\'] ?? null         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题