PHP scripting language, is one of languages used on web development applications
But programming basics, is to learn about dataTypes
SO, what are dataTypes in PHP?
We have :
- Boolean : is the status of something, may be 1 (True) or 0 (False)
like : $bool = true;
- String : is a sentence that contains various characters (can hold letters, numbers, special characters..ect) , where every character is the same as byte. Largest value that can be stores as a string is 2GB (2147483647 bytes maximum)
like : $str = "Hello 6èh@@";
- Integer: is a number
like $int= 5;
- Floating point number : is a float number that contains numbers after comma,
like : $float = 2.3;
- Arrays : is a variable who can contains more than one value at a time
like : $arr ('jugurtha', 'gaci');
- NULL : is a values that represent that a varibale is empty (contains nothing)
-PHP OBJECTS: An object is a data type that not only allows storing data but also information on, how to process that data. An object is a specific instance of a class which serve as templates for objects.
Every object has properties and methods corresponding to those of its parent class. Every object instance is completely independent, with its own properties and methods, and can thus be manipulated independently of other objects of the same class.
Here's a simple example of a class definition followed by the object creation.
PHP DATA types
Reviewed by Jugurtha Gc
on
juillet 30, 2020
Rating:
Aucun commentaire: