Home >Backend Development >PHP Tutorial >php中html的显示问题

php中html的显示问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:16:081064browse

html的显示问题


$url="home.php";

$name=2;

echo "$name";

echo "".$name."";

?>

最后2行输出是一样的

不同的地方在于 ".$url." 和 直接 $url

".$name."和 $name

区别在哪里?

回复讨论(解决方案)

 ".$url."  如果是做需要在输出的时候解释的话,为什么不加上转义字符?像下面这样。

   echo "".$name."";

echo "$name";

echo "".$name."";
没有区别,只是后者更隐晦

转义符\"".$url."\"

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn