SimplePie_Misc::absolutize_url PHP Method

absolutize_url() public method

public absolutize_url ( $relative, $base )
    function absolutize_url($relative, $base)
    {
        $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
        return $iri->get_iri();
    }

Usage Example

 function find($uri = NULL)
 {
     $ret = array();
     if (!is_null($this->data($uri))) {
         if ($this->is_feed($uri)) {
             $href = array($this->uri);
         } else {
             // Assume that we have HTML or XHTML (even if we don't, who's it gonna hurt?)
             // Autodiscovery is the preferred method
             $href = $this->_link_rel_feeds();
             // ... but we'll also take the little orange buttons
             $href = array_merge($href, $this->_a_href_feeds(TRUE));
             // If all that failed, look harder
             if (count($href) == 0) {
                 $href = $this->_a_href_feeds(FALSE);
             }
             // Our search may turn up duplicate URIs. We only need to do any given URI once.
             // Props to Camilo <http://projects.radgeek.com/2008/12/14/feedwordpress-20081214/#comment-20090122160414>
             $href = array_unique($href);
         }
         /* if */
         // Try some clever URL little tricks before we go
         $href = array_merge($href, $this->_url_manipulation_feeds());
         $href = array_unique($href);
         // Verify feeds and resolve relative URIs
         foreach ($href as $u) {
             $the_uri = SimplePie_Misc::absolutize_url($u, $this->uri);
             if ($this->verify and ($u != $this->uri and $the_uri != $this->uri)) {
                 $feed = new FeedFinder($the_uri);
                 if ($feed->is_feed()) {
                     $ret[] = $the_uri;
                 }
                 unset($feed);
             } else {
                 $ret[] = $the_uri;
             }
         }
         /* foreach */
     }
     /* if */
     return array_values($ret);
 }
All Usage Examples Of SimplePie_Misc::absolutize_url