adambeazley Posted September 28, 2009 Share Posted September 28, 2009 Hello, I have been having a hell of a time trying to figure out this preg_replace function. Here is the deal: I have a CMS and the {thumbnail} variable will output something like: <img src="http://www.mysite.com/images/image.jpg" alt="some descriptions" class="rimage"> I need to use the {thumbnail} variable and strip out the image url out of the image src code. This is what i have so far, but it is not working: <?php echo preg_replace('/.*src=([\'"])((??!\1).)*)\1.*/si','$2','{thumbnail}'); ?> any ideas? Link to comment https://forums.phpfreaks.com/topic/175859-solved-preg_replace-help/ Share on other sites More sharing options...
adambeazley Posted September 28, 2009 Author Share Posted September 28, 2009 never mind I figured it out. The code was right, but I had a setting wrong in my CMS. Link to comment https://forums.phpfreaks.com/topic/175859-solved-preg_replace-help/#findComment-926624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.