View Full Version : help with IMG (not quite sure how to define)

04-20-2004, 11:29 AM
hey all :)

i am a bit of a newb and was wondering if someone could help me!

basically, i have a DB that stores IMG's by code, so i have like a img_id, img_url, img_txt, and img_title. Now i have a way of grabbing the URL and putting it into the img src tag, thats no problem.

i am using this feature in a news system i am developing for my site and was wondering, is there way i could like just insert a small tag like <img=101> into my story and have the pic come up?

I hope i haven't confused u all.

thanks very much!

04-20-2004, 01:18 PM
I suppose you could do it bb style, like this:


Then in your php do something like this...

$imgID = preg_match('/\[img=(.*?)\]/i', $_POST[formVar']);

04-20-2004, 01:35 PM
ok thanks but i dont get that.. so that code will convert [img=101] to like <img src=101.jpg> or soemthing?