Sorry I'm fairly new to PHP and I'm getting this error when trying to use an argument from a function. What am I doing wrong?
public function legislatorsByZip($zip = null) {
$url = "...";
$params = [
zip => $zip,
];
$data= $this->curl->simple_get($url, $params);
return $data;
}
error:
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant zip - assumed 'zip'
Filename: models/CongressAPI.php
Line Number: 11
(zip=> $zip is line 11 btw) Please let me know if you need more info..