Skip to main content

Assignment

Assignment Operators in PHP
Assignment operators basically used to assign one value in other variable or assign one variable value to other variable.

Operator
Sign
 Description  

Addition 

+

To make a sum of two or more than two values

Example :

<?php $a=10 ; $b=20 ; echo $a+$b ?> Output : 30

Subtraction 

-

To find a difference between two or more than two values.  

Example : 

<?php $a=10 ; $b=20 ; echo $b+$a ?> Output : 10

Multiplication

*

To perform a Multiplication between two or more than two values

Example : 

<?php $a=10 ; $b=20 ; echo $a*$b ?> Output : 200



Division


/

To perform division between two values where as one value is Quotient and other value is divider of that Quotient values

Example : 

<?php $a=10 ; $b=20 ; echo $b/$a ?> Output : 2



Modulus


%

To find the reminder after division operation, so modules operation performs the divide operation internally and it shows the reminder 

Example : 

<?php $a=10 ; $b=4 ; echo $a/$b ?> Output : 2

i.e.   10/4   Then   4*1=4,    4*2=8 

So will keep  8 as its less than 10 and closer to 10 , then the reminder is 2    ( 10-8 = 2)




Comments

Popular posts from this blog

EXPORT TO EXCEL

H IS AGENT IS USED TO EXPORT THE CURRENT VIEW DATA TO EXCEL- Procedure :  1. Create New Lotus Script Agent with Menu Selection property 2. Copy Below Complete Lotus Script Code and Paste it in Initialize  3. Save this agent with proper name 4. Close the agent and goto any view in your database 5. Find your agent name in "Action" Menu and run it. 6. Excel File will be ready to desktop. 7. Done. EXPORT TO EXCEL ANY VIEW : Const  visualproc  =   True   'Display Visualvisual progress bar true = yes /false = no Const  AppConst  =   "Excel.Application" Const  AppConst2  =   "Excel.Application.8" Const  NPB_TWOLINE%  =   1 ' Procedures in nnotesws.dll (undocumented!!). Dim  db  As  NotesDatabase Dim  view  As  NotesView Dim  doc  As  NotesDocument Dim  nc ,  nl ,  nmore Dim  selList ( 0   To   ...