Made a alpha check work in php, using two loops