<?php $html = ' [My Test URL 1|https://www.mywebsite.com/test?param=1] [My Test URL 2|https://www.mywebsite.com/test?param=2] [My Test URL 3|https://www.mywebsite.com/test?param=3] [My Test URL 4|https://www.mywebsite.com/test?param=4] '; echo preg_replace('/\[(.*?)[|](.*?)\]/', '<a href="$2">$1</a>', $html);
You have javascript disabled. You will not be able to edit any code.