TEKNIK INFORMATIKA
Type PHP Data
- Type of Data
Is a data type that is commonly used to determine the type of value that can be represented by a variable, generally provide the types of data (simple) or structured. When we need a data type that is not yet available, we can define their own new data type called an enumerated type .
- PHP ( Hypertext Preprocessor)
Is a
language
programming
server-side script that is designed
to
develop the
web. In
addition , PHP also
can
be used
as
language
programming
in general .
Types PHP Data
There are 6 types of data in php are:
1.Tipe Boolean Data
Boolean data type is used to find the truth, the truth is "True" or "False".
Ø A simple example, consider doing the following script:
2. Data Type Integer
Is the numeric data type.
Ø A sample script follows:
3. Floating Point Data Types
This type of data is another word for data type double , a type number with precision.
Ø A sample script follows:
4. Data Type String
String is the combination of the characters. A word or phrase included in the category string.
Ø A sample script follows:
There are things that need to be considered in relation to the declaration of integer and string data types, declaration string should be enclosed in single quotes or double quotes like the above example, if you declare an integer data type to be in quotes, it will be treated as a string data type by php.
5. Data Type Array
A row of data is collected in a name, a row of data in the array is called element.
Ø A sample script follows:
<?
$ Name = array ("guy" => "Jono", "girl" => "Susi");
echo "Name Day = $ name [guy] China";
echo "The name Night = $ name [girl] China";
?>
Saved by the name of the array , php , then you run through localhost .
6. Type Data Object
Ie php support object-oriented programming (OOP). OOP features a modular design improvements, simplify debugging and maintenance.
Class is part of the object-oriented design. A class is a definition of a structure that contains properties (variables) and methods (functions).
Ø A sample script follows:
<?
class memasak_air {
function cooking () {
return " Prepare the equipment to cook , pour water into the pan and boil the water to boil . ";
}
}
$ obj = new memasak_air ;
echo "How the cooking water is & nbsp ; ". $ obj -> cooking ();
?>
Sumber referensi :
http://2bprogrammer.blogspot.co.id/
modul, Bapak M.Ropianto, M.kom Type data PHP
Semoga Bermanfaat.................
Dosen Pengampu Mata kuliah Algoritma Dan Pemrogaman 3
Nama : M.Ropianto, M.Kom
NIDN :1028067804
Status : Dosen tetap Yapista/STT Ibnu Sina, Batam.
Silahkan kunjungi juga website :http://stt-ibnusina.ac.id/








god job
BalasHapus