PHP Assignment Operators Explained

in this episode we're going to talk about something called assignment operators inside PHP and this is going to be a very short episode cause assignment operators are really not that difficult to understand i'm just going to give you guys some examples to show you guys what they are so as you guys can see on the screen here I did actually write that we have a variable called X which is equal to a hundred and then underneath it I just simply echoed out X so inside my browser you can see we get a hundred now let's say dad before I echoed out i want to change the value of x now the way we could do it is by saying well we do have a variable called X which is equal to variable X because we did actually said already plus 20 so right now if I were to echo out this inside my browser you can see we've got 220 now because we as PHP developers don't like writing a lot of code we can actually write this in a much smaller way so instead of writing you know variable X equal to a variable X plus 20 we can actually just right 20 and other type of the equal sign and before the equal sign we're going to go ahead and write plus this automatically means that we're going to take variable X and put it on the other side of the equal sign as well and then it's going to be you know either plus or minus or whatever right before the equal sign to the number we have behind here so if actually go ahead and refresh the browser now we should get the same number which is 220 so we can also go ahead and use to module list we can also use to other you know exponentiation want to use that that we talked about in the last episode so I want to write you know / 20 you can see they will actually get five or like you know five inside the browser so this is basically what assignment operators are and this is basically what we're going to cover in this episode I'm just going to leave it off here and in the next episode we're going to talk about comparison operators inside PHP so hope you guys enjoyed last you guys next time