From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Adding comments to PHP scripts - PHP Tutorial
From the course: PHP for Web Designers
Adding comments to PHP scripts
It doesn't matter how experienced you become at writing php or any other type of code. When you come back to a script several months later, the meaning won't always be obvious. So it's useful to add comments to remind you what the code was for. Comments are also a useful way of disabling parts of a script when troubleshooting problems. PHP has three different styles of comments. Two of them are the same as in JavaScript, so let's deal with them first. And to make it a little bit easier to see where the comments are, I'm going to reorganize the script in this page so the PHP is on a beginning of a line. Just move that. The first style of comment is anything between two forward slashes and the end of the line. Is treated as a comment and ignored by the php engine. So, after this echo stringtoupper city I'm going to add a comment. I type in two forward slashes. And I'm using Dream Weaver as my editor. You can see that it's already changed the color to orange. That's syntax highlighting…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
How PHP makes web pages dynamic5m 23s
-
(Locked)
How to use PHP in a web page6m 43s
-
(Locked)
Using variables to store information2m 52s
-
(Locked)
Storing numbers and text in variables5m 18s
-
(Locked)
Displaying the values of number and text variables8m 9s
-
(Locked)
Using functions to manipulate values4m 36s
-
(Locked)
Adding comments to PHP scripts4m 46s
-
-
-
-
-
-
-
-