可能重复:
PHP String concatenation - “$a $b” vs $a . “ ” . $b - performance
<?php
$url = 'http://www.google.com/';
//case 1
$case1 = 'The URL is '.$url.'.';
//case 2
$case2 = "The URL is $url.";
//case 3
$case3 = 'The URL is {url}.';
$case3 = str_replace('{url}', $url, $case3);
?>
谢谢!
答案 0 :(得分:2)