phphtml-title

Which is correct on echo variable


I'm Appserve with PHP 5.2 and this code was working fine

<?PHP
// after connection to DB and getting title from setting table
$title = $line['wptitle'];
?>
<title><?=$title?></title>

But after I've start using Vertrigo Serv with PHP 5.3, the above code no longer shows the title and only if I edit it to

<title><?PHP echo $title; ?></title>

Is <?=$title?> is no longer acceptable?


Solution

  • Just make sure that in your php.ini file you have:

    short_open_tag=On
    

    as well you can put in your .htaccess file:

    php_flag short_open_tag on