drath Posted July 19, 2008 Share Posted July 19, 2008 Wasn't really sure what to title the thread, and I think this is where this type of post would go: I'm not the greatest with PHP but i've already got the part where I can create a nice string with the source code from a page (using snooper). Now, I'm having a problem grabbing the IMG tag properly. And yes, I am using preg_match_all (for an array) and this code as it is now: $pattern = '/src=[\'"]?([^\'" >]+)[\'" >]/'; This normally would work, but in this "advanced" case, I need to also remove the first instance of the http://, which may be utilizing the function "substr", but so far I have been unsuccessful. To illustrate, this is the string I now get: http://domain.com?h?:=http://realimage.com/realone.jpg *I bolded the middle part as it may be important in removing the first half. As you can see, I will need to strip the first part somehow, either using preg_match or somehow dynamically using substr. This is a little over my head , so I need a little bit of help from you "freaks", haha. Quote Link to comment Share on other sites More sharing options...
drath Posted July 19, 2008 Author Share Posted July 19, 2008 Just an update... I have successfully used the substr() function the remove the first part... although that will only work as long as the front page remains constant. It works for now, anybody have any other ideas for in the future? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted July 20, 2008 Share Posted July 20, 2008 What exactly do you want to do? Please provide a better example. 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.