When I write
<?=?>
in my PC it’s not working,but it’s work in 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 this, it’s too simple no ? 🙂
<?= expression ?>
This is a shortcut for
<? echo expression ?>
or
<?php
$i ="test";
?>
<h1><?=$i?></h1>
Thanks for your advice 🙂
You don’t have the short tags enabled.
To enable them look for
short_open_tags inphp.ini. Change it to “On” and restart Apache.