我有課,我想initalize與類型「斑點」存儲線框圖列,但我不知道怎麼辦?看看代碼的緯線如何初始化圖片「斑點」形構造PHP
public function __construct($data=array()) {
if (isset($data['id'])) $this->id = (int) $data['id'];
if (isset($data['date'])) $this->date= (int) $data['date'];
if (isset($data['topic'])) $this->topic = preg_replace ("/[^\.\,\-\_\'\"\@\?\!\:\$ a-zA-Z0-9()]/", "", $data['topic']);
if (isset($data['author'])) $this->author = preg_replace ("/[^\.\,\-\_\'\"\@\?\!\:\$ a-zA-Z0-9()]/", "", $data['author']);
if (isset($data['content'])) $this->content = $data['content'];
if (isset($data['picture'])) $this->picture ="Here sholud be the Type" $data['picture'];
}
初始化它作爲字符串存儲。 – 2012-04-05 05:37:16
http://php.net/manual/language.types.type-juggling.php – 2012-04-05 06:03:23