Some elements are essential for developing any type of application, among these elements mathematical operators and functions related to string some of these elements are essential, without them it would be impossible to perform any kind of processing. Therefore it is important to understand how they are declared and how they are worked in programming.

In PHP the arithmetic operators are worked very simply, using the signals already known patterns is easier assimilates them and implement them accordingly.

Check out the examples below to arithmetic operators in PHP:

$var = 2 +2 / / Addition

$var = 2-2 / / Subtraction

$var = 2/2 / / Division

$var = 2 * 2 / / Multiplication

The variable $var assumed the operation result according to the calculation.

You can also use the calculations with variables that take a value at the beginning of the implementation, as shown below:

$var2 = 2;

$var = $var2 +2 / / Addition

$var = $var2 -2 / / Subtraction

$var = $var2 / 2 / / Division

$var = $var2 * 2 / / Multiplication

Another element widely used in PHP are the strings, this type of data is represented by any textual content.

$var = “Text 1”;

$var2 = “text 2”;

One of the most common operators in string is the concatenation, it is possible to join two strings in the same variable, as in the example below:

$var = “Text 1”;

$var2 = “text 2”;

$var3 = $ var. “”. $var2;

The variable $var3 assumed then the value “Text1 Text2”.

These basic operators are part of everyday life for all programmers who work with the PHP language and more than that, are essential in any type of activity.

php

If you are taking your first steps in the development of PHP applications count on one of the development tools that are market benchmark, Scriptcase. Go to the download page, download the free version now and start right now to enjoy all the benefits that only Scriptcase offers.

You might also like…

PROCESAMIENTO AJAX EN SCRIPTCASE

Ajax en los formularios de Scriptcase puede usarse para recargar un campo de tipo de select basado e...

IMPORTAR IMAGENES DE LA BASE DE DATOS Y UTILIZAR CLASES DE BOOSTRAP

Como muchas personas ya saben, Bootstrap es una biblioteca de front-end libre y de código abierto p...

TENDENCIAS DE DESARROLLO WEB PARA 2017

Usted verá en este post tendencias para 2017 en Diseño Web, en el medio digital y en el desarrollo...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.