gpt4 book ai didi

php -

转载 作者:可可西里 更新时间:2023-11-01 00:10:34 25 4
gpt4 key购买 nike

环境:Windows/7 + Apache/2.2.21 + PHP/5.3.8

test.php 的文件内容:

hello, <?=$test?>

index1.php 的文件内容:

<?php
$test = 'world';

require './test.php';
?>

index2.php 的文件内容:

<?php
global $test;
$test = 'world';

require './test.php';
?>

index1.php 的输出是:

hello,

index2.php 的输出是:

hello, world

test.php的内容是:

hello, <? echo $test; ?>

index1.php 的输出和 index2.php两者都是:

hello, world

所以,我的问题是:<?=$test?> 之间有什么区别吗?和 <? echo $test; ?>

最佳答案

不,没有区别。我唯一想到的是 <?被视为短标签,可能无法正常工作。

关于php - <?=$value?> 和 <? echo $值; ?>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8375733/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com