exploding a string with variable
问题 I'm trying to manipulate a path to an image using php. The path has a variable userdirectory in it, so i'm struggling with how to write this. Ive used to do : $texthtml = $content; if (preg_match('/<img.+src=[\'"](?P<src>.+?)[\'"].*>/i', $texthtml, $image) ) { $promopic = $image['src']; } to find if there is an image in my content and make a variable out of it. that works, but i need to alter my code to load image from a thumbnail directory for pageload reasons. an image src looks like this :