Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- preg_match_all(self::$urlRegex, $this->content, $match,PREG_SET_ORDER);
- foreach($match as $url) {
- $url = array_shift($url);
- $shortResponse = $this->shortUrl($url);
- if(!empty($shortResponse->shorturl)) {
- $shorted = sprintf('<a href="%s" target="_blank" rel="tooltip">%s</a>',$shortResponse->shorturl,$shortResponse->shorturl);
- $this->content = str_replace($url, $shorted, $this->content);
- }
- }
- print $this->content;
Add Comment
Please, Sign In to add comment