I try with this code:
$username = "lucia-villatoro-lópez-1ba32618a";
$profileurl = "https://www.linkedin.com/in/".$username;
$fp = curl_init($profileurl);
echo "FP --->";
var_dump($fp);
$response = curl_exec($fp);
echo "<br>response--->";
var_dump($response);
$response_code = curl_getinfo($fp, CURLINFO_HTTP_CODE);
echo "<br>response_code--->";
var_dump($response_code);
$validprofile = ($response_code == 200);
echo "<br>validprofile--->";
var_dump($validprofile);
die();
But linkedin send this response : 999
Status code 999 – a non-standard code is returned by some sites (e.g. LinkedIn) which do not permit scanning.
https://hexometer.com/http-status-codes/#:~:text=Status%20code%20999%20%2D%20a%20non,which%20do%20not%20permit%20scanning.