本文实例讲述了PHP实现C#山寨ArrayList的方法。分享给大家供大家参考。具体如下:
class ArrayList
{
public $length;
public $name;
public $my_array;
function __construct()
{
$this->my_array=Array();
}
public function Add($element)
{
array_push($this->my_array, $element);
}
public function get_Length()
{
$this->length=