是否可以使用 php 将 null
转换为 string
?
例如,
$string = null;
到
$string = "null";
最佳答案
在 PHP 7 中,您可以使用 Null coalescing operator ??
$string = $string ?? 'null';
关于php - 将 null 转换为字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9913447/