Jump to content

Using single and double quotes with strings


EY

Recommended Posts

The biggest difference is that you can only use variables inside of strings if the string in inside of double quotes.

 

Example:

 

<?php
$var = "Hello";
// Won't Work
echo '$var'; // will display $var

// Will Work
echo "$var"; // will display Hello
?>


 

Simple example, let me know if you need further details.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.