/ Published in: PHP

Expand |
Embed | Plain Text
<?php class Set { protected $_storage_array; function __constructor() { } function add($value) { $this->_storage_array[$value] = $value; } function hasValue($value) { } function toArray() { } } $data = new Set; $data->add("Sarah"); $data->add("Jamie"); $data->add("Phil"); $data->add("Jamie"); /* Returns the following: Has Value Jamie? true Array ( [0] => Sarah [1] => Jamie [2] => Phil ) */ ?>
You need to login to post a comment.