PHP - Difference with quotes
Wed, 24 Oct 2007 02:51:09
Today we're going to focus on a 60 second refresh. The question we've been asked is this "What's the difference when working with a string and single quotes or double quotes?" We answer with an example.
<?php
$var = "This is a";
print "$var test<br>";
print '$var test';
?>
The output would appear as;
This is a test
$var test
The major difference between double and single quotes is that contents within single quotes are taken literally. If you have any variables within them, they will not be translated into their values.
60 second refresh over
Cheers
Ryan Partington
<?php
$var = "This is a";
print "$var test<br>";
print '$var test';
?>
The output would appear as;
This is a test
$var test
The major difference between double and single quotes is that contents within single quotes are taken literally. If you have any variables within them, they will not be translated into their values.
60 second refresh over
Cheers
Ryan Partington


