answersLogoWhite

0

Four scalar types of PHP

String

String is used for binary data. This can be text, content of an image file etc.

$today = 'hey how are you';

Int

For numeric values, Int is used. Int can contain a positive or a negative number.

$total = 20000000;

$temperature = -14 ;

Float

Float is used for numbers that have a fractional component. Float can also contain positive or negative values.

$length = 145.78;

$growthRate = -5.216;

Sometimes name Double is used for Float values.

Boolean

Boolean is used for values that are either true or false. You would often see Boolean values in conditional statements.

if (($age > 12) && ($age < 20)) {

$teenage = true;

} else {

$teenage = false;

}

//Some content goes here

if ($teenage) {

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What are the four scalar types of PHP with examples?

Boolean: true or false - $foo = true;Integer: 0 or 1 - $foo = 7;Float (Double): 0.5 or 6.2 - $foo = 5.5;String: "bar" or "foo" - $foo = "bar";


What are the types of scalar quantity?

APPLES


What are the different types of errors in PHP?

basicly four type errors in php warnings fatal notices parse and internly e_fatal e_warning e_fatal e_user_error e_user_warning e_user_fatal e_core_error e_core_warning e_compile_error e_recvoverable_error e_strict e_all


What are the types of scalar quantization?

There are two types of quantization .They are, 1. Truncation. 2.Round off.


What is CMS and its Type in PHP?

CMS is a Content Management System, Some types of CMS's that are written in PHP would be WordPress, Drupal, Joomla. Is this what you were asking?


What is scalar data?

A scalar variable can hold only one piece of data at a time. So in C, C++ and Java scalar data types include int, char, float and double, along with others. Scalar variables of the same type can be arranged into ascending or descending order based on the value. Prasangax


What is scalar data structures?

A scalar variable can hold only one piece of data at a time. So in C, C++ and Java scalar data types include int, char, float and double, along with others. Scalar variables of the same type can be arranged into ascending or descending order based on the value. Prasangax


How many data types are there in PHP?

The data types are grouped into this categories: Booleans Integers Floating point numbers Strings Arrays Objects


Is scalar quantiy is added with vector quantity?

A scalar quantity added to a vector quantity is a complex quantity. An example is a complex number z = a + ib, a is the scalar and ib is the vector quantity.If the vector quantity is 3 dimensional, ib + jc + kd, then the scalar and vector forms a quaternion quantity.


What is 10 percent in Php 250?

Answer: Php 2510% of Php 250= 10% * Php 250= 0.10 * Php 250= Php 25


Is time a scalar or a vector?

Scalar


Is mass is scalar?

No, mass is not a scalar quantity. It is a scalar quantity. Scalars have only magnitude and no direction.