■array(配列)
いくつかのデータにキーを振って、まとめて管理する。
<?php $ary[0] = 'dog'; $ary[1] = 'cat'; $ary[2] = 'fish'; ?>
■object(オブジェクト)
任意のデータと処理をまとめたもの。
<?php class Sample { private $val; public static function setVal($val){ //code } } $obj = new Sample(); ?>
■その他のデータ型
null
変数に値が何も代入されていない事を示す
Resource
外部とのやり取り用の識別子
<?php $txt = ''; $fh = fopen('sample.txt', 'r'); while($row = fgets($fh,0)){ $txt .= $row; } fclose($fh); $dbh = mysql_connect(DB_HOST, DB_USER, DB_PASS); ?>