How should I go about parsing a url in php? I wanna make it so it goes
[url=http://www.google.com]Google[/url]
Turns into:
<
$post = preg_replace('/\[url=(.+?)\](.+?)\[\/url\]/', '\2', $post);
That will turn: [url=http://google.com]Google[/url]
Into parsed bbcode text: Google
You'll probably want to use more specific regex than just .+ to filter out potentially bad/dangerous input.