tags: apache   archive   business   charity   climbing   comic   communication   database   email   exchange   family   fm2008   hack   hardware   humour   linux   liverpool   microsoft   money   mysql   network   oes   opensource   outlook   php   pictures   process   project   quote   real_life   review   rss   science   security   software   thought   tsm   updates   webdev   website   windows  

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