I want to display content in a php page from a .txt and change some tag to a html code like the following using:
Change this:
[img: something.jpg]
To this:
<img src="something.jpg" />
I've tried to use preg_replace, but I have no idea how to use those symbols like /(){}^*.:.
What it means to use things like this to extract some variables $1 $2 from a string?
$string = 'April 15, 2003';
$pattern = '/(\w+) (\d+), (\d+)/i';
echo preg_replace("/\[img:\s*([^\]]+)\]/i","<img src='$1'>",$string)