hi everyone this is Raghu from tutorial dr.com and welcome to PHP video series so in this lecture we will see the more about assignment operators so let’s open our text editor so create a new file we’ll save it as assignment assign anything dot PHP so start with the PHP tag so as I mentioned in my previous lectures so the assignments operators are nothing but equals and then plus equals minus equals and then star equals multiplication equals divide quotes and the last one is modulus equals so it looks like they have many but in fact we have only one assignment operator that is equal so this is the only operator we have so but why I am talking about all these so if he if you see plus equals plus equals is nothing but we are correct okay we will see an example then it will be clear so let’s start so take two variables x equals 100 and then y equals 5 now I am doing simple operators arithmetic operators and then let’s display the output so I can use some code from mathematical operators so just everything so what I am doing here is I am assigning my Z value as X so here we are using equals and here I am assigning hunted to my variable X so this is another assignment operator so here I am using assignment operators so that’s why we have only one assignment operators but here also we are using assignment operators but instead of using okay so here we have three variables but what if we have only two variables like I want to do something like x equals x plus 1 so in these situations okay instead of using x equals x plus y we can use simply x plus y equals y it means add x + y and then assign this value to X I can tell you in another way so if you find any of these operators X plus y equals something so just understand that take the left side value and equals left side value and whatever the operator we have then Kreitzer value that’s okay similarly if you have something like 6 – equals y you can get back left side value and then left side value then the operator right so it is very simple so here this is simple assignment operator so otherwise I will use just x and y okay I use just x and y so let me echo X value is and so I have x and y because we already assigned values to x and y and then what I am using what I am doing is X plus equals one so it means add Y to X so addition of x and y is maybe I shouldn’t use something like this I should because if I print this the x value will be changed so okay just use very I’ll just keep similarly modulus so let’s see what will be the output based on that I can explain how it work assignment so here if you see X value is 100 by value is 5 initially then what we did x place equals y which means add X plus y and then assign to X so I got a 1 0 5 and now minus equals means subtract Y value from X so Y value is 5 and then I subtracted so I got 100 and then here now the new x value is 100 so all these are the X values by while is constant 5 and now multiply X with Y so I got 500 so similarly division and remainder is 0

Tags:






Youtube
Facebook
Google Plus
Twitter
TutorialDrive


Apache Zookeeper Tutorial

Apache Kafka Tutorial

Apache Kafka Security

Elasticserarch n Kibana

Java 8 Tutorial

Log4J Tutorial

Apache Storm Tutorial

SQLite Tutorial

Apache Ant Tutorial

Related Posts

blog

Apache Kafka Commands Cheat sheet

Spread the loveKafka Topics List existing topics bin/kafka-topics.sh –zookeeper localhost:2181 –list Purge a topic bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –config retention.ms=1000 … wait a minute … bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –delete-config retention.ms
Read more…

blog

What is Apache Maven | Apache Maven complete tutorial from scratch pdf

Spread the love In this post you will learn the complete tutorial of Apache Maven build tool What is Maven ? Apache Maven is a software project management and comprehension tool. Based on the concept
Read more…

blog

Practical Guide for Web Development in 2018

Spread the loveWelcome to my practical guide  for web development in 2018 in terms of  technology and career. Before we start I just want to  mention a few things, you don’t need to learn  everything that
Read more…