So the error was happening when I seperated these two like this so that it would fix an error with the <font color =green> html code not working. Then from there php was telling me the fix. To add a comma between the " and '. Thus it was fixed. Im a newbie at php by the way.
echo "$ServerName is "'<font color="green">Online</font><br>';
echo $servername . " is <font color=\"green\">Online</font><br />";
or echo $servername . ' is <font color="green">Online</font><br />';
thirdly a echo "$servername is <font color=\"green\">Online</font> <br />";
Either of them would fix that issue. The comma that you're using isn't quite proper.. a period would be correct though. (The period concatenates the strings.)
You can and you should (if you care about the few nanoseconds) whenever it's possible instead of concatenation, although opcode caches (accelerators / optimizers, whatever you want to call them) nullify the advantage.
echo, being the odd language construct it is, does things a bit differently from regular functions and even its fellow language constructs.
Well, to be frank, my big projects all use a template engine and end up having only a single echo echo'ing a large string anyway. It's a neat performance booster to keep in mind for CLI (PRISM :razz or smaller, inline-markup'd projects though.
Over 160 BILLION packets, a few nanoseconds can build up to real time. Assuming you save 2ns from each operation, and on each packet you use the string operator once, you could save 320 seconds over the course of the applications run time. That's five minutes and 20 seconds. Considering that one second is equivalent to 31.7 years, stupid small optimizations can make a huge difference over the lifetime of your application.