顯示具有 PHP 標籤的文章。 顯示所有文章
顯示具有 PHP 標籤的文章。 顯示所有文章

2010-01-27

PHP Object Basics

  • Class and objects: Declaring classes, instantiating objects
  • Constructor methods: Automating the setup of your objects
  • Primitive and class types: Why type matters
  • Inheritance: Why we need inheritance, and how to use it
  • Visibility: Streamlining your object interfaces and protecting your methods and properties from meddling

  • 類別與物件 : 如何宣告類別, 實例化物件
  • 建構式方法 : 初始化物件
  • 原型類別     : 建構原型需要留意哪些事項
  • 繼承             : 為何需要繼承, 我該如何使用它
  • 可視性         : 物件的特性與介面透過封裝來保護物件與物件之間的溝通


2010-01-25

primitive types and ckecking functions in PHP

Type Checking
Function
Type Description
is_bool()
Boolean
one of the two special values true or false
is_integer()
Integer
A whole number
is_double()
Double
A floating point number (a number with a decimal point)
is_string()
String
Character data
is_object()
Object
An object
is_array()
Array
An Array
is_resource()
Resource
A handle for identifying and working with external resources such as databases or files
is_null()
NULL
an unassigned value

2010-01-23

PHP 基本資料型別


PHP 基本資料型別

  • 4 種 scalar (純量型別)

    • boolean

    • integer

    • floating (double)

    • string

  • 2 種 compound (複合型別)

    • arrays

    • objects

  • 2 種 special type (特殊型別)

    • Resource

    • NULL




提示 scalar (純量) :
只有大小(magnitude),
例如:質量(mass),體積(volume),長度(length), 速率(speed),時間(time),溫度(temperature)

引用參考  :  scalar (純量)