Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
Author « Topic »  

1818charlie
ECT Moderator

United Kingdom
1198 Posts

Posted - 06/13/2020 :  12:47:17  
At the moment this is just curiosity. It's not related to an ECT template

Why the difference in using a single quote ' & a semicolon ; in the first line as against the double quote " & no semicolon followed by a space in the second line?

<?php include 'footer.php';?>

<?php include "folder/inc/footer.php" ?>

Steve

Bolton Lancashire England



Edited by - 1818charlie on 06/13/2020 13:46:42

Vince
Administrator

42874 Posts

Posted - 06/13/2020 :  15:31:28  
Hi Steve
Good question. But in this case very little.
Statements in PHP have to be terminated with a semi-colon, but the ?> to end a PHP block will also end a statement so the semi colon here isn't necessary.
And strings in double quotes will have their contents parsed for variables. So you could use for instance...
<?php
$myvar=277;
print "The value is $myvar";
?>
And that would display
The value is 277
In single quotes that would display
The value is $myvar
But as in this case there are no variables, again there would be no difference.

Vince


Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

1818charlie
ECT Moderator

United Kingdom
1198 Posts

Posted - 06/14/2020 :  10:38:00  
Hi Vince

Thanks for that, much clearer now

Steve

Bolton Lancashire England
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000