I would try searching the PHP manual, but its hard to search for . , heh. Anyway, when I see stuff like . $foo . , what do those periods do?
well okay, it concatenates.....
but is it possible not to use it in the following example? print "<td>" . $row[title] . "</td>";
and just type print "<td> $row[title] </td>"; instead?
Yea, both work in your example...
Yeah, as Allen pointed out, that works.
However, if you use code like: print "<td>" . $row['title'] . "</td>";
you can't just type: print "<td> $row['title'] </td>";
-Ben
Like Ben and Allen said, it does work. Placing your variables directly in the string, instead of concatenating them, is called variable interpolation. Concatenating strings with variables or functions is often a way of making your code more readable since it's then easier to find those vars and functions in case you need to edit or debug the script.
-geoff
<<<<you can't just type: print "<td> $row['title'] </td>"; >>>>
actually... I believe you can still do that as long as you use double quotes.
Try it. It won't work. Gives you an array error.
I tried it. It worked. shrugs