Pop\Curl\Curl::getOption PHP Method

getOption() public method

Get a cURL session option.
public getOption ( integer $opt ) : string
$opt integer
return string
    public function getOption($opt)
    {
        return isset($this->options[$opt]) ? $this->options[$opt] : null;
    }

Usage Example

Beispiel #1
0
 public function testSetAndGetOptions()
 {
     $c = new Curl('http://www.popphp.org/version', array(CURLOPT_RETURNTRANSFER => true));
     $c->setOption(CURLOPT_HEADER, false);
     $this->assertEquals(1, $c->getOption(CURLOPT_RETURNTRANSFER));
     $this->assertEquals(0, $c->getOption(CURLOPT_HEADER));
 }