I need to capture only the values of html inputs returned from curl_exec () function. This function returns the full html of the page, is there any way to take only the values of the inputs?
my code:
public function searchUser(Request $request){
$data = $request->all();
$cURL = curl_init('http://www.example.com/result.php');
curl_setopt($cURL, CURLOPT_HEADER, false);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$dados = array(
'num_cnpj' => $data['cnpj'],
'botao' => 'Consultar'
);
curl_setopt($cURL, CURLOPT_POST, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $dados);
curl_setopt($cURL, CURLOPT_REFERER, 'http://www.example.com/index.php');
$result = curl_exec($cURL);
curl_close($cURL);
return $result;
}