Jump to content

using ' or "


brown2005

Recommended Posts

<?php

$var = 'foo';

echo '$var'; // outputs "$var"
echo "$var"; //outputs "foo"

?>

 

<?php

$var = 'foo';

echo '$var'; // outputs "$var"
echo '$var: '.$var; // <-- I like this one best
echo "$var"; //outputs "foo"

?>

 

Line 3 is ok for short lines of text, but for massive SQL statements with tons of variables in it it gets hard to read.

 

I think line 2 is faster than line 3.

 

monk.e.boy

Link to comment
https://forums.phpfreaks.com/topic/41600-using-or/#findComment-201619
Share on other sites

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.