Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP syntax issue

I have just downloaded a PHP blog script and am having a few issues with the syntax used in it.

There are several instances when this code occurs:

<?=$miniblog_posts?>

Now this doesn't do anything. To get it to work I have to change it to this.

<?php echo $miniblog_posts; ?>

Is this an old way of writting php that is not supported anymore or am I missing something.

I am running PHP V5.3.1

like image 649
Samuel Meddows Avatar asked Dec 10 '22 07:12

Samuel Meddows


1 Answers

http://php.net/manual/en/function.echo.php

See the shortcut syntax doc.

echo() also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. This short syntax only works with the short_open_tag configuration setting enabled.

like image 51
Jan Zyka Avatar answered Jan 02 '23 09:01

Jan Zyka