Jump to content

Small question about $title


Webman123

Recommended Posts

Hi all,

 

I used to use this function in my projects to show the data.

<?=$title;?>

Especially, in some shared code, i also see this function. But according to some of my friends, they said that is old-school coding style.

 

I wonder to know is it true? Is there any better coding than this?

 

P/s: I myself learn to code PHP. Sorry for my bad English.

Link to comment
Share on other sites

It is an old technique that may not work in a lot of servers today, it's being phased out in the next PHP version. The proper way to do it is like this:

<?php echo $title; ?>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...