<?php
dotnet::Imports('System.Collection.Generic.Dictionary');
class IndexOf {
private $__data;
function __construct($array){
$this->__data = new Dictionary;
$max = sizeof($array);
for($i = 0; $i < $max; $i++) {
$this->__data->Add($array[$i], $i);
}
}
public function IndexOf($key) {
if($this->__data->ContainsKey($key)) {
return $this->__data->Item($key);
} else {
return -1;
}
}
public function GetJson() {
return $this->__data->GetJson();
}
}
?>