bubblenut, thankyou for that, I think it does contain some errors, but since I dont totally understand how this works yet im not sure where they are 😛
really this is a whole new world to me, having spent the night reading the relevant pages in the php manual (thanks weedpacket for the link) I'm more confused than ever.
preg_replace('/<img(.*?)src=(["'])(.*?)\/([^\/]*?)\2','<img\1src="http://www.site.com/new/pic/path/\4"',$string);
ok, what exactly does (.*?) capture. what doesnt it capture (what does it stop at?)
(.*?)\/ how does that capture http://www.adomain.com/randomfile/images bit and how does it know when to stop?
([\/]*?) how does this identify just the file name?