WEBVTT

00:00.890 --> 00:04.130
I welcome you back again to another video lecture in PHP.

00:04.130 --> 00:08.450
And in this video lecture we go ahead and look at comments in PHP.

00:15.560 --> 00:18.260
Oh, I saw comments play a vital role.

00:18.290 --> 00:19.070
Yes.

00:19.100 --> 00:24.140
Why I said it plays a vital role is because someone will say hey, this is comments.

00:24.170 --> 00:26.300
What role does comments play?

00:26.600 --> 00:32.720
Comments plays a vital role in PHP and in other programming languages, because you can actually use

00:32.720 --> 00:38.600
comments to be able to make your work look more simplified and manageable.

00:38.600 --> 00:44.540
So we can actually go to your work, understand what is happening, and then be able to manage your

00:44.540 --> 00:45.260
code.

00:45.560 --> 00:49.910
So comments are not doing that in PHP.

00:49.910 --> 00:51.530
So let's go ahead and see.

00:51.530 --> 00:53.930
We have this code equal.

00:53.930 --> 01:02.600
And we go ahead and say uh welcome to p h p and a semicolon at the end thereof.

01:02.600 --> 01:03.830
We'll go ahead and run this.

01:03.830 --> 01:04.130
We have.

01:04.130 --> 01:05.150
Welcome to PHP.

01:05.180 --> 01:10.290
Now if I go ahead and write anything here, it's going to an error.

01:10.560 --> 01:13.560
So yes, if I go ahead and check this out you see an error.

01:13.590 --> 01:23.460
Now if I go ahead and try to convert this to be comments, what I need to do is I can put double O for

01:23.460 --> 01:25.920
slash and go ahead and save this.

01:25.950 --> 01:28.680
Ah first is the error is gone.

01:28.680 --> 01:36.270
So anything that you write after this double forward slash is a comment.

01:37.470 --> 01:43.560
Now if I go down here and I'm going to copy this, let's copy this again.

01:43.620 --> 01:45.930
And I'll go ahead and paste that.

01:45.930 --> 01:48.210
And then go ahead and write another thing.

01:48.450 --> 01:51.810
And then we always know it's going to throw an error.

01:51.810 --> 01:53.400
If I run this you have an error.

01:53.400 --> 01:59.790
And then we go ahead and put this a hashtag and run this code.

01:59.820 --> 02:01.080
The error is gone.

02:01.770 --> 02:04.170
So you can use double for slash.

02:04.200 --> 02:09.270
You can use a hashtag to actually create a single line comment.

02:09.930 --> 02:12.970
In PHP it is called a single line comment.

02:13.360 --> 02:21.400
If you use double forward slash or single hashtag, that is a single line comment.

02:21.430 --> 02:27.700
Now why I say this plays a vital role in PHP and other programming languages is that you can actually

02:27.700 --> 02:33.400
specify what this line of code is actually doing, or what this block of code or a function is a try

02:33.430 --> 02:36.040
doing, and what someone wants to manage that.

02:36.220 --> 02:42.550
Uh, the person can actually understand what this code is doing, and it can be able to actually, uh,

02:42.550 --> 02:46.390
troubleshoot or work on your code or further improve that.

02:47.020 --> 02:49.420
So you can see that it is very, very interesting.

02:49.450 --> 02:52.900
Now we have what is called a multiple line comment.

02:52.930 --> 03:00.970
Now if I go over here and put this word in here, you can see that if I run this code I have an error

03:00.970 --> 03:04.900
because everything down here is no longer functioning.

03:05.500 --> 03:06.850
What happened?

03:07.240 --> 03:12.220
It happened because this is a multiple line comment that includes job.

03:12.250 --> 03:18.140
So if I go down here and, uh, put in exteriors Serious and false lash again.

03:18.140 --> 03:27.350
You can see if I run this code and nothing is printed out because everything, everything that is inside.

03:27.350 --> 03:29.810
Here is a comment right now.

03:29.810 --> 03:32.600
So is a multiple line comment.

03:32.630 --> 03:39.050
Now if I go ahead and remove this, let's go down here and I'll go ahead and put a forward slash exteriors.

03:39.050 --> 03:44.720
And then I'm going to type anything and move down to the next line and move down to the next line and

03:44.720 --> 03:46.220
move down to the next line.

03:46.220 --> 03:49.010
And now if I go ahead and save this, I'll run this code.

03:49.130 --> 03:51.440
We'll go to PHP, we'll come to PHP.

03:51.800 --> 03:57.260
Now let's go ahead and put a brick right in here and uh, run this code again.

03:57.290 --> 03:58.550
Welcome to PHP.

03:59.600 --> 04:06.380
So you can see we have single line comments with a double forward slash and the single hashtag.

04:06.410 --> 04:09.440
Either one of them can be used as a single line comment.

04:09.440 --> 04:16.520
Then for multiple line comments, use forward slash exteriors and whatever it is in there to any amount

04:16.550 --> 04:28.560
of line is double line or multiple line comment, then You can actually use these to improve your code.

04:28.860 --> 04:35.730
Write and tell people who are going to manage your code whatever a block of code is doing.

04:35.760 --> 04:37.410
So that is very interesting.

04:37.410 --> 04:45.060
So we're going to need that in the in this course we are actually going to always in this course we're

04:45.060 --> 04:52.770
going to always meet comments, because I will be using that to actually make my code more easier and

04:53.070 --> 04:55.290
able to implement some of the things I want to do.

04:55.290 --> 05:00.090
So instead of deleting this, maybe I have these two I want to work with, one I can go ahead and put

05:00.090 --> 05:01.860
the double forward slash.

05:01.860 --> 05:03.600
And then that is a comment.

05:03.600 --> 05:06.900
So I can actually now print out one.

05:07.800 --> 05:09.060
So I hope that is cool.

05:09.090 --> 05:12.030
Now if I go ahead and refresh this I have just one.

05:12.030 --> 05:13.170
Welcome to PHP.

05:13.230 --> 05:16.530
Now I can modify this and use that later somewhere else.

05:16.860 --> 05:18.390
So go ahead and play around with it.

05:18.390 --> 05:22.050
And if you have any question, please go ahead and use the question and answer section.

05:22.050 --> 05:24.480
And I'm going to get back to you as soon as possible.

05:24.510 --> 05:25.440
Thank you so much.

05:25.440 --> 05:28.350
And I'm going to see you in the next video lecture.
