
$wynik=curl_exec($ch); curl_close($ch); $pattern = '#<input id="ID" type="hidden" value="(.*?)" name="NAME">; preg_match($pattern, $wynik, $matches); print_r($matches);
Id jest stałe, type raczej też

$wynik=curl_exec($ch); curl_close($ch); $pattern = '#<input id="ID" type="hidden" value="(.*?)" name="NAME">; preg_match($pattern, $wynik, $matches); print_r($matches);