WEBVTT

00:00.680 --> 00:04.040
I will call you back again to another video lecture in PHP.

00:04.190 --> 00:09.500
And in this lecture we go ahead and look at data types in PHP.

00:16.400 --> 00:19.850
So in the previous lecture we are able to look at variables.

00:19.850 --> 00:26.240
And during the time we are treating variables we talked about strings and we talked about integers.

00:26.240 --> 00:30.890
We didn't go deep into them because we have not discussed about data types.

00:30.920 --> 00:34.190
So what are data types in PHP?

00:35.300 --> 00:38.750
In PHP we are going to specify ten.

00:38.750 --> 00:43.100
In PHP that we are going to use certain uh informations.

00:43.100 --> 00:50.630
And these informations are either stored as strings or integers or fluids or a boolean.

00:50.840 --> 00:53.990
So let's go ahead and look at strings.

00:55.010 --> 00:55.940
Let's go ahead and see.

00:55.940 --> 00:57.410
This is a string.

00:57.410 --> 01:05.510
And uh this string I just wrote right in here we are going to pass this string into a variable, and

01:05.510 --> 01:11.210
then we use double quotation mark to actually say that this is a string.

01:11.210 --> 01:14.630
So whatever is inside double quotation mark is a string.

01:14.630 --> 01:16.220
So I'll go ahead and delete this.

01:16.220 --> 01:18.410
And I'm going to create a variable.

01:18.410 --> 01:24.470
And I'm going to say this is a my string.

01:24.530 --> 01:25.850
Remember this is a variable.

01:25.850 --> 01:27.470
So you can name it anything.

01:27.470 --> 01:28.970
So I just say my string.

01:29.000 --> 01:29.570
Okay.

01:29.600 --> 01:35.900
Now I will go ahead and put a double quotation mark or I'll go ahead and use single quotation mark.

01:35.900 --> 01:43.220
Because when I is a string, the string will either be either in a double quotation mark or a single

01:43.220 --> 01:44.150
quotation mark.

01:44.180 --> 01:46.490
Let's go ahead and start with single quotation mark.

01:46.490 --> 01:51.620
And I'm going to say this is a welcome to PHP.

01:51.650 --> 01:58.670
Then put a semicolon at the end and then we'll go ahead and encode this.

01:58.670 --> 02:00.080
So let's go ahead and echo this.

02:00.080 --> 02:07.760
And I'm going to just say echo my string and put a semicolon at the end.

02:07.760 --> 02:10.370
And then let's go ahead and run this and check it out.

02:10.400 --> 02:18.800
We come to FB so you can see that string can either be in a double quotation mark or a single quotation

02:18.800 --> 02:19.220
mark.

02:19.220 --> 02:24.800
So when we've discussed about variables we put everything inside double quotation mark.

02:24.800 --> 02:27.200
But now I've just made that to be a single quotation mark.

02:27.200 --> 02:32.510
So it is either a double quotation mark or it is either in single quotation mark.

02:32.870 --> 02:36.260
Now the next one we're going to talk about is integers.

02:36.290 --> 02:38.180
Integers are just numbers.

02:38.180 --> 02:41.900
You can either use any number a whole number.

02:41.900 --> 02:47.000
So one of whenever we talk about whole numbers we talk about integers.

02:47.090 --> 02:47.750
All right.

02:47.780 --> 02:49.460
Now let me go ahead and create this.

02:49.460 --> 02:51.470
And I'm going to see my gnome.

02:51.470 --> 02:56.000
So the variable name is just my gnome okay.

02:56.030 --> 03:02.120
And now once you want if you want to write an integer is going to be just a whole number.

03:02.150 --> 03:02.780
All right.

03:02.780 --> 03:06.170
And let's go ahead and equal this out.

03:06.830 --> 03:12.560
So my my gnome All right.

03:12.560 --> 03:19.430
And we have to write a code and then put a semicolon at the end and run this.

03:19.460 --> 03:22.970
And you can see we have this 60.

03:23.390 --> 03:26.930
Uh, this is a 67.

03:27.170 --> 03:27.740
All right.

03:27.770 --> 03:30.170
Now I want this to move to the next line.

03:30.170 --> 03:44.870
You can actually go right in here and, uh, put a code and then brick because we are using HTML right

03:44.870 --> 03:45.110
here.

03:45.140 --> 03:46.490
Now let's go ahead and run this.

03:46.520 --> 03:48.740
You can see that this has moved to the next line.

03:48.740 --> 03:54.590
So you can place this in uh, maybe inside this my string or you put that inside here.

03:54.740 --> 03:55.310
All right.

03:55.310 --> 03:57.380
So I don't want this to be equal everywhere.

03:57.380 --> 03:58.670
I'll go ahead and copy this.

03:58.670 --> 04:00.560
I'll go ahead and delete this.

04:00.680 --> 04:01.280
All right.

04:01.310 --> 04:05.030
Now I have my string and I'm going to put this here.

04:05.060 --> 04:07.310
Now, if I run this code, I'm going to.

04:07.550 --> 04:09.620
Oh I got an error right in here.

04:09.650 --> 04:12.410
So that is equal my string.

04:12.410 --> 04:18.810
So what I need to do is that I have to place this right inside this double quotation mark.

04:18.810 --> 04:20.070
So let me go ahead and take everything out.

04:20.070 --> 04:20.970
Quotes right inside.

04:21.000 --> 04:24.270
Double quotation mark now.

04:26.670 --> 04:28.710
Oh I'm having this problem.

04:28.740 --> 04:29.250
Okay.

04:29.280 --> 04:33.870
Now I put everything right inside the double quotation mark and I'll go ahead and run my code again.

04:33.900 --> 04:34.950
Welcome to PHP.

04:35.070 --> 04:42.330
And you can see the line break is already here and it has moved to the next line 6 to 7.

04:42.660 --> 04:45.300
So now we have our integer.

04:45.330 --> 04:48.900
I'll have to bring the next one is a decimal numbers.

04:49.170 --> 04:53.790
So decimal numbers are different from whole numbers.

04:53.790 --> 04:59.880
So if you go ahead and say dollar sign my.

05:02.430 --> 05:03.660
My decimal.

05:03.660 --> 05:09.720
So let's go ahead and say this is equal to 67.03 semicolon at the end.

05:09.840 --> 05:16.950
Now PHP actually knows that 67 is quite different from 67.0.

05:18.060 --> 05:22.530
So 67 Seven is quite different from 67.0.

05:22.560 --> 05:26.430
The first one is an integer, while the second one is a float.

05:26.460 --> 05:31.800
All right, this is my decimal and not NY.

05:31.830 --> 05:35.730
So you can actually go ahead and practice with these.

05:35.760 --> 05:40.440
So the first one here is called a an integer right.

05:40.440 --> 05:43.470
And last one is called a float number.

05:43.590 --> 05:45.720
So the next one is boolean.

05:45.900 --> 05:48.210
Let's go ahead and say we have a.

05:48.240 --> 05:50.490
This code is my bull.

05:50.490 --> 05:52.230
So we can call this my boolean.

05:53.190 --> 05:53.700
All right.

05:53.700 --> 05:56.460
So this is equal to true or false.

05:56.550 --> 06:03.240
It is either it is true or it is either a false.

06:03.630 --> 06:04.140
All right.

06:04.140 --> 06:08.490
So it is either true or it is either a false.

06:09.210 --> 06:09.600
Okay.

06:09.630 --> 06:17.430
So whenever we are going to use this we're going to always let you know when and when to use it in the

06:17.430 --> 06:17.880
program.

06:17.880 --> 06:22.620
So as we move into PHP we're going to make use of all these data types.

06:22.620 --> 06:28.980
Because whenever you are writing PHP code, you're always going to use data types to actually make your

06:28.980 --> 06:31.230
code to be manageable.

06:31.500 --> 06:34.950
All right, now that's all PHP actually outputs.

06:34.950 --> 06:36.780
And that is called null.

06:36.810 --> 06:37.230
All right.

06:37.260 --> 06:41.370
So null is actually there for you to send no value.

06:41.400 --> 06:43.620
No means no value.

06:44.340 --> 06:44.760
All right.

06:44.910 --> 06:46.470
So I hope you understand this.

06:46.470 --> 06:48.180
No means no value.

06:48.210 --> 06:48.780
All right.

06:48.780 --> 06:54.450
These things are these are going to use to make our code to be functional.

06:54.450 --> 06:57.150
It helps us to write code that are functional.

06:57.150 --> 06:58.890
So you always use strings.

06:58.890 --> 07:00.720
You always use data types.

07:00.720 --> 07:05.310
And the data types are going to use a string.

07:05.340 --> 07:10.470
Integers or decimal numbers Boolean and so on.

07:10.680 --> 07:14.280
So this is just an introduction to data types.

07:14.310 --> 07:15.540
I'll move into the course.

07:15.570 --> 07:17.070
We're going to discuss more on that.

07:17.070 --> 07:21.300
And if you have any questions please go ahead and use the questions section.

07:21.300 --> 07:23.760
And I'm going to get back to you as soon as possible.

07:23.790 --> 07:24.780
Thank you so much.

07:24.780 --> 07:28.230
And I'm going to see you in the next video lecture.
