mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-16 05:29:39 +01:00
Created defaultLinkTo (markdown)
parent
cb443360ca
commit
09222a4633
18
defaultLinkTo.md
Normal file
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
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user