KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

PHP Types


PHP supports eight primitive types.

Four scalar types:

boolean (expresses a truth value. It can be either TRUE or FALSE.)

integer (is a number of the set Z = {..., -2, -1, 0, 1, 2, ...}. )

float (floating-point number, aka 'double', like $a = 1.234;)

string (is series of characters)

Two compound types:

array

array is actually an ordered map. This type is optimized in several ways, so you can use it as a real array, or a list (vector), hashtable (which is an implementation of a map), dictionary, collection, stack, queue and probably more. Because you can have another PHP array as a value, you can also quite easily simulate trees.


An array can be created by the array() language-construct. It takes a certain number of comma-separated key => value pairs.

<?php
$arr = array("foo" => "bar", 12 => true);

echo $arr["foo"]; // bar
echo $arr[12]; // 1
?>

A key may be either an integer or a string.

object

To initialize an object, you use the new statement to instantiate the object to a variable.

<?php
class foo
{
function do_foo()
{
echo "Doing foo.";
}
}
$bar = new foo;
$bar->do_foo();
?>

two special types:

resource

A resource is a special variable, holding a reference to an external resource. Resources are created and used by special functions

NULL

NULL is the only possible value of type NULL. Used like $abc=null

some pseudo-types:

mixed

mixed indicates that a parameter may accept multiple (but not necessarily all) types.

number

number indicates that a parameter can be either integer or float.

callback

Callback functions can not only be simple functions but also object methods including static class methods.


PHP Calendar
Comprehensive PHP Web Calendar
Configurable PHP Calendar
PHP Calendar
PHP Image Processing
PHP grahic softwares
PHP create real-time dynamic chart
create antispam image(image verification)
Add water mark to image
PHP Image processing introduction
Add text on Image
Create thumbnail for image
Create image from text on fly
PHP code sample
PHP create dynamic PDF with FPDF
PHP create dynamic PDF with PDFLib
PHP create dynamic PDF with ClibPDF
Improved PHP configurable hit counter
Install phpMyAdmin,MySql, PHP
PhpMyAdmin export/import data
A simple PHP RSS feed reader
PHP include (SSI)
Working with Forms
PHP formmail Generator
Using phpMyAdmin Create Database
Insert Form Data into Database
Retrieve data from Database
Retrieve multiple records
Batch insert text using phpMyAdmin
Using phpMyAdmin insert binary file
Insert binary file using PHP code
Using form insert binary file into MySQL
Retrieve binary file from MySQL
Image hosting business in minutes
Send HTML mail in PHP
Send bulk emails in PHP
Polling/Rating System in PHP
Polling/Rating System in PHP(radio button)
Check visitor's IP address
Check reciprocal link
PHP tutorial
What is PHP?
Install PHP on Windows XP (part1)
Install PHP on Windows XP (part2)
PHP open and closing tags
PHP types
Variables
Constants
Operators(part1)
Operators(part2)
Logic Structures
Include files
Loops
Set cookie and delete cookie
Most often used MySQL functions

 

 

 

Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © kidslovepc.com All rights reserved(new). Privacy|Copyright
designed by info@kidslovepc.com

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer