dtyqflrr775518 2012-12-30 22:50 采纳率: 100%
浏览 10
已采纳

<?php,<?,<?=,有什么不同? [重复]

Possible Duplicate:
Reference - What does this symbol mean in PHP?

I don't know if this has been asked before, but here goes: What's the difference between <?php, <?=, and <??
I'm just curious, and people have been telling me to use <?php instead of <?, but I just use <? because it works for me and it's faster. I ain't seein' no diff'rence (redneck accent for extra pleasures...).

  • 写回答

1条回答 默认 最新

  • dongyu8694 2012-12-30 22:52
    关注

    <?php and <? are equivalent, except it's generally preferred to use <?php since not every server configuration may have the short opening PHP tags option enabled.

    <?= is a shortcut for echoing back the value of a variable/expression, i. e.

    <?=$var ?>
    

    is similar to

    <?php echo $var; ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀