flexes his regular expression muscles
Ok - regular expression is gonna be your best bet...
something like this
preg_match_all("/\<input\s+type=text\s+name\s*=\s*[\"\']?(.+?)[\"\']?\s+value\s*=\s*[\"\'](.*?)[\"\'][^\>]*\>/i", "<input type=text name='fred_1' value='stuff'>", $arrMatches);
I know it looks messy - bit it aint that difficult...
it reads soemthing like this...
find anything starting "<input", followed by at least 1 whitespace character "\s+", followed by "type=text", followed by at least 1 whitespace character "\s+", followed by "name" and some white space, then an "=" and some white space, then an optional (one or 0) speech mark "[\"\']?", then the name with minimal matching ".+?" then an optional closing speechmark....
etc etc... the rest just follows this same pattern.
I am sure there is probably a nicer way of doing this, but hopefully it will help you in the right direction.
Oh, btw, the results are in $arrMatches, just take a look at the array using "print_r($arrMatches)" and then I'm sure you can work the rest out from there 🙂