Read the PHP manual(!)
to count the elements use count()
to find the posistion of an element,
for ($t=0;$t<count($array);$t++)
{
if ($array[$t]=="value")
{
echo $t;
}
}
Notice that this loop always continues the search after a match, because in some cases an array can contain the same value several times.