2
Is there any way to add new items without rewriting the code ?
See: If there are cookies then I use CURLOPT_COOKIE
If not, I don’t use:
if ($cookies) {
$options = [
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_COOKIE => implode('; ', $cookies),
CURLOPT_USERAGENT => $this->ua
];
} else {
$options = [
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_USERAGENT => $this->ua
];
}
Add new items to the $options array?
– Taffarel Xavier
That’s right. @Taffarelxavier
– user148010