我是SQL的新手,我想知道是否有任何区别:
// Adding customer
// pass cust_name,phone,address and apikey
$app->post('/customer', function ($request, $response, $args) {
$_message = $request->getParsedBody();
$customer = new Customer();
$customer->cust_name = $_message['cust_name'];
$customer->phone = $_message['phone'];
$customer->address = $_message['address'];
$customer->apikey = $_message['apikey'];
$payload=[];
$customer->save();
if ($customer->id) {
$payload = ['cust_id' => $customer->id,
'cust_uri' => '/customer/' . $customer->id
];
return $response->withStatus(201)->withJson($payload);
}else {
return $response->withStatus(400);
}
});
和
not variable is null
答案 0 :(得分:2)
实际上两个术语都没有区别。它们都指的是变量的可空性。
如果有任何差异,那么阅读的简单性。