Jump to content

Recommended Posts

Either one works, but the best all depends on your style.

 

Personally my favorite would be this:

 

<?php
echo "My name is " . $name;
?>

 

strictly because that way I know no funny business will happen to my variables. That is just how I do it.

honestly... its really down to personal preference...

personally... i template everything... so all my stuff is stored in strings, untill it hits the template.php in which is 99% html code... where i <?=$var?>

 

What does it do?

<?php
<?=$var?>
?>

 

Nothing anymore it has been depreciated. Best practice is to use this:

 

<html>
<title><?php print $var; ?></title>

 

Essentially what it used to do was just print a variable to the string, but some issues arose with that so they made that functionality depreciated as of 4.4 I believe not sure.

 

Anyhow if you plan on upgrading php anytime soon that will break anyscripts that use that methodology.

honestly... its really down to personal preference...

personally... i template everything... so all my stuff is stored in strings, untill it hits the template.php in which is 99% html code... where i <?=$var?>

 

What does it do?

<?php
<?=$var?>
?>

 

Nothing anymore it has been depreciated. Best practice is to use this:

 

<html>
<title><?php print $var; ?></title>

 

Essentially what it used to do was just print a variable to the string, but some issues arose with that so they made that functionality depreciated as of 4.4 I believe not sure.

 

Anyhow if you plan on upgrading php anytime soon that will break anyscripts that use that methodology.

 

What type of issues arosed?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.