PHP syntax issue

I just downloaded the PHP script blog and have several problems with the syntax used in it.

When this code occurs, there are several cases:

<?=$miniblog_posts?> 

Now it does nothing. To make it work, I have to change it to this.

 <?php echo $miniblog_posts; ?> 

This is an old way of writing php that is no longer supported, or I'm missing something.

I am running PHP V5.3.1

+4
source share
5 answers

Yes, it is called short open tags and is now disabled by default. You can change your configuration to include them, but this is not recommended because they will be removed from the next version of PHP (possibly in php 5.4)

Information on settings and individual files is given on this page: http://php.net/manual/ini.core.php

+4
source

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

See the shortcut syntax document.

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

+6
source

You must include a short tag in php.ini to make <?=$miniblog_posts?> .

 short_open_tag=On 

Here are some related posts that may also help you understand:

+2
source

I think you might need to include short_open_tag in your php.ini file. Or you can configure to .htaccess. how

 short_open_tag on 
+1
source

PHP short string designation <?= ?> Depends on php.ini , you must change state to enable short open tag . While the code <?php ?> Can work every time everywhere, without any configuration.

+1
source

All Articles