-
CAPITAL or small
This code:
1: $MESSAGE = "(img)http://site.con/photo.gif(/img)";
2: $MESSAGE = str_replace("(IMG)", "<IMG src='", $MESSAGE);
3: $MESSAGE = str_replace("(/IMG)", "'>", $MESSAGE);
4: $MESSAGE = str_replace("(img)", "<IMG src='", $MESSAGE);
5: $MESSAGE = str_replace("(/img)", "'>", $MESSAGE);
to replace (img)http://site.con/photo.gif(/img) to HTML img code, and I repeat line 2,3
because may be user right (IMG) Capital or small.
Qusetion : There are any function to replace string to another string if this string capital
or small untill I do not repeat the code.
-
use eregi_replace instead of str_replace
-
See my other post regarding BB code. :)
-
Thanks