Quotes are needed in variables that contain strings which include spaces in them, characters such as the exclamation mark that could conflict with code syntax, or HTML, javascript, etc.
Will work:
PHP Code:
$string = "hello world";
or
$string = helloworld;
or
$string = 12342342345345;
Wont work:
PHP Code:
$string = hello world;
or
$string = 32423 234234;
or
$string = <b>helloworld</b>;
or
$string = helloworld!!!;