我正在努力学习更多关于PHP函数sprintf()的知识,但是php.net对我帮助不大,因为我仍然很困惑,您为什么要使用它呢?
看看我下面的例子.
为什么要用这个:
$output = sprintf("Here is the result: %s for this date %s", $result, $date);
如果这也是同样的,并且更容易编写IMO:
$output = 'Here is the result: ' .$result. ' for this date ' .$date;
我错过什么了吗?