Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //first the difference between single and double quotes:
  2. print " here is $a <br />";
  3. print ' and here is $a again<br />';
  4.  
  5. //notice how we use HTML tags inside the quotes to format the display,
  6. //just as if we were writing a static web page?
  7.  
  8. //now for some fun...
  9. echo "$b can be escaped by using backslash to show up as though it was inside single quotes like this : \$b <br />";
  10.  
  11. echo "You can use echo for longer
  12. values that span several
  13. lines of code, but that still need HTML to <br />format on the final page<br />";
  14.  
  15. print "when displaying values from variables you don't NEED to use any quotes - ";
  16. echo $status;
  17.  
  18. echo "<br /><br />when using echo we can also use a lone . to join things together the same as we used .= with the variable :<br />" . $travels . 'you can even join together diffent types of quotes and you can use several . s to'.
  19. ' make bigger statements. <br /><br />';
  20.  
  21. echo 'another time that you might find the escape character (backslash) handy is when you need to use a single quote inside a single quote, like "He said \'I\'m not falling for that!\'".';
  22.  
  23. //EOF -- same point of refference as the last time.