replaced preg_match that replaced eregi, with manually generated attributo array