The exact curl user-agent string will be different based on version. For example this one:
curl/7.15.1 (i386-pc-win32) libcurl/7.15.1 OpenSSL/0.9.8a zlib/1.2.3
So what you can do is, check whether the curl
or libcurl
is existed in the agent string or not.
if(preg_match("/curl|libcurl/", $usera)){
// do something ...
}
But if the curl
client change the Agent String
, then you'll not be able to detect it. For example with below curl
request I am changing the user agent into Opera 9.0
curl -A "Opera 9.0" http://www.example.com/