David Carrdcblogdev.hashnode.devยทJan 28, 2016Extract image source from img tagTo extract the image source from this: <p><img alt="" src="/images/logo.jpg" style="width: 300px; height: 97px;" /></p> Use preg_match to extract the image src: $img = stripslashes($source); $str = preg_replace('#<p>.+?src=[\'"]([^\'"]+)[\'"].+<...Add a thoughtful commentNo comments yetBe the first to start the conversation.