Why <? =?> Works on one computer, but not on another?
When I write
<?=?>
it doesn’t work on my PC, but it works on another PC !!! Why ??? :( for example:
<?php
$courses = CourseManager::findAll();
?>
<h3>Course List</h3>
<table>
<tr><th>Name</th></tr>
<?php foreach ($courses as $c){
?>
<tr>
<td><?=$c->getName()?></td></tr>
<?php } ?>
</table>
or is it too simple not? :)
<?= expression ?>
This is a shortcut for
<? echo expression ?>
or
<?php
$i ="test";
?>
<h1><?=$i?></h1>
Thanks for your advice:)
+3
5 answers
PHP short_open_tag options do not match on different servers. If possible, avoid using these types of open tags.
, , ini_set.
+5
Since these shortcuts can be disabled in php.ini. This option is called short_open_tags.
0