SimpleBrowser::get PHP Method

get() public method

Fetches the page content with a simple GET request.
public get ( string/SimpleUrl $url, hash/SimpleFormEncoding $parameters = false ) : string
$url string/SimpleUrl
$parameters hash/SimpleFormEncoding
return string Content of page or false.
    public function get($url, $parameters = false)
    {
        if (!is_object($url)) {
            $url = new SimpleUrl($url);
        }
        if ($this->getUrl()) {
            $url = $url->makeAbsolute($this->getUrl());
        }
        return $this->load($url, new SimpleGetEncoding($parameters));
    }

Usage Example

Example #1
0
 function testBack()
 {
     $browser4 = new SimpleBrowser();
     $browser4->get("http://www.google.com/");
     $browser4->get("http://www.yahoo.com/");
     $browser4->back();
     $browser4->getTitle();
     $this->assertEqual($browser4->getTitle(), 'Google');
 }
All Usage Examples Of SimpleBrowser::get