PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
eregs are greedy.
Perhaps your ereg returns
<img src="somethin[/imgg][imgg]something_else"></img> if you ran it on such a string:
[imgg]somethin[/imgg][imgg]something_else[/imgg]
Am I right?
You can switch to PERL regexps (preg_* family of functions, look up the PHP manual). They supports U modifiers for switching the 'greedyness' of pattern.
You can use [^[]* (inverse character class, this subregexp matches all character but opening square bracket: