fork download
  1. <?php
  2.  
  3. function make_links_clickable($text){
  4. return preg_replace('~\[url=[^\]]*](*SKIP)(?!)|(((f|ht)tps?://)[-a-zA-Zа-яёЁА-Я()0-9@:%_+.\~#?&;/=]+)~iu', '<a href="$1">$1</a>', $text);
  5. }
  6. $text = "@Theareak We know this and [b][url=https://w...content-available-to-author-only...e.com/news/67/False-positive-proxy-bans-and-bot-attacks]here[/url] [/b]is an explanation, we are trying to fix this asap! https://w...content-available-to-author-only...e.com/news/67/False-positive-proxy-bans-and-bot-attacks aaa";
  7. echo "<b>Parsed text:</b><br>";
  8. echo make_links_clickable($text);
Success #stdin #stdout 0.03s 52472KB
stdin
Standard input is empty
stdout
<b>Parsed text:</b><br>@Theareak We know this and [b][url=https://w...content-available-to-author-only...e.com/news/67/False-positive-proxy-bans-and-bot-attacks]here[/url] [/b]is an explanation, we are trying to fix this asap! <a href="https://w...content-available-to-author-only...e.com/news/67/False-positive-proxy-bans-and-bot-attacks">https://w...content-available-to-author-only...e.com/news/67/False-positive-proxy-bans-and-bot-attacks</a> aaa