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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.