Malhar Lathkar has Published 189 Articles

PHP Constants

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 15:00:15

246 Views

IntroductionConstants are represented literally in an assignment expression such as $x=10 or $name="XYZ" where 10 and XYZ are numeric and string constants assigned to variables. In PHP, it is possible to define a constant with a user defined identifier with the help of define() functionSyntaxdefine ( string $name , mixed ... Read More

PHP String Data Type

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:58:10

2K+ Views

Definition and UsageIn PHP, a string data type is a non-numeric sequence of charaters.Any character in the ASCII set can be a part of a string. PHP doesn't support UNICODE.In PHP, literal representation of string can be done with single quotes, double quotes, with heredoc syntax and nowdoc syntax.Syntax//Literal assignment ... Read More

PHP Resources

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:53:19

6K+ Views

Definition and UsageIn PHP, Resource  is a special data type that refers to any external resource. A resource variable acts as a reference to external source of data such as stream, file, database etc. PHP uses relevent functions to create these resources. For example, fopen() function opens a disk file ... Read More

PHP NULL

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:48:05

5K+ Views

Definition and UsageIn PHP, a variable with no value is said to be of null data type. Such a variable has a value defined as NULL. A variable can be explicitly assigned NULL or its value been set to null by using unset() function.Syntax$var=NULL;It is possible to cast variable of ... Read More

PHP Multidimensional Array.

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:46:44

817 Views

Definition and UsageA multidimensional array in PHP an be treated as an array of arrays so that each element within the array is an array itself. Inner elements of a multi dimensional array may be associative or indexed.Although arrays can be nested upto any levels, two dimensional array with more ... Read More

PHP Type Juggling

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:43:42

3K+ Views

Definition and UsagePHP is known as a dynamically typed language. Explicit type declaration of a variable is neither needed nor supported in PHP. Contrary to C, C++ and Java, type of PHP variable is decided by the value assigned to it, and not other way around. Further, a variable when ... Read More

PHP Iterables

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:41:10

640 Views

Definition and UsageFrom version 7.1 onwards, PHP provides a new pseudo-type called iterable. Any object (such as array) that implements Traversable interface is acceepted by it. This type uses foreach construct or a generator function that yields one value at a a time.SyntaxA function can have iterable as type of ... Read More

PHP Integer Data Type

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:38:43

346 Views

Definition and UsageIn PHP, Integer is a scalar data type that represents a numeric constant represents a whole number wihout any fractional part. PHP allows an integer to be expressed in decimal, hexadecimal, octal or binary number system by prefixing appropriate symbol.By default Integer is assumed in decimal notation. For ... Read More

PHP Indexed Array

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:34:19

994 Views

Definition and UsageA comma separated sequence of values only instead of key=>value pairs. Each element in such collection has a unique positional index starting from 0. Hence, it is called Indexed array.Indexed Array object can be initialized by array() function as well as assignment by putting elements inside square brackets [].Syntax//Indexed ... Read More

PHP Floating Point Data Type

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:31:53

529 Views

Definition and UsageIn PHP, float data type represents any number with a provision to contain a fractional part. The fractional part may contain digits after decimal point, or may be represented in scientific notation using either e or E. For example 100 in scientific notation is 10e2.Size of a float ... Read More

Previous 1 ... 4 5 6 7 8 ... 19 Next
Advertisements