Stuff
public php v1 · immutable$text = 'cod html';preg_match_all('/<input\b(?:[^>]*\btype="text"[^>]*\bname="([^"]+)"[^>]*|[^>]*\bname="([^"]+)"[^>]*\btype="text"[^>]*)>/i', $text, $matches);$subregex = array(1, 2);$names = array();foreach($subregex as $regex){ foreach($matches[$regex] as $match) { if (trim($match)) { $names[] = trim($match); } }}print_r($names);