php null replacement function
问题 there is this function called Nz() in visual basic for application. the function checks variable nullity and returns a provided value if it finds the variable is null. i try to write the same function in php, which looks like below: function replace_null($value, $replace) { if (!isset($value)) { return $replace; } else { return $value; } } $address = replace_null($data['address'], 'Address is not available.'); of course, if $data['address'] is found null, php will stop executing the code and