Code: Select all
$post-text = ereg_replace('\[img\]\( \)\[/img\]', '<img src="\1" />', $post-text);Or would this be much easier if I used a completely different approach?
Note: another plus would be if it could detect if 'url' has no spaces and/or ends in 'jpg', 'png', or 'gif', but right now I'm just going for the basic functionality.