Created defaultLinkTo (markdown)

LogMANOriginal 2019-05-02 20:59:07 +02:00
parent cb443360ca
commit 09222a4633

18
defaultLinkTo.md Normal file

@ -0,0 +1,18 @@
Automatically replaces any relative URL in a given string or DOM object (i.e. the one returned by [getSimpleHTMLDOM](The-getSimpleHTMLDOM-function)) with an absolute URL.
```php
defaultLinkTo ( mixed $content, string $server ) : object
```
Returns a DOM object (even if provided a string).
**Remarks**
* Only handles `<a>` and `<img>` tags.
**Example**
```php
$html = defaultLinkTo($html, 'https://www.github.com/rss-bridge/rss-bridge'); // Using custom server
$html = defaultLinkTo($html, $this->getURI()); // Using bridge URL
```