TheMayhem Posted May 1, 2011 Share Posted May 1, 2011 I currently have an array called: $find[pagetext] In this array, there is going to be one to several instances where I am looking for a specific forum coding called: [url=http://megaupload.com/?d=X]http://megaupload.com/?d=X[/url] Everyone has used megaupload but what this script basically is going to do is check the validity of the upload site the user has chosen. Above I selected megaupload but there are about 6 sites I am going to check in the code I'm writing. I'm stuck on 1 part. How can I extract from $find[pagetext] all occurances of the website (In this case) megaupload and assign each instance to array. Once I assign it to an array I've already written a function that will check and see if the web link is valid I just need to basically extract each URL occurance of megaupload or whatever the upload site I am checking there is. All help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/235310-need-some-help-with-some-string-extraction/ Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 you would use a foreach loop to cycle through your array keys and values...then compare the values to the url that youd like Link to comment https://forums.phpfreaks.com/topic/235310-need-some-help-with-some-string-extraction/#findComment-1209239 Share on other sites More sharing options...
TheMayhem Posted May 2, 2011 Author Share Posted May 2, 2011 Can you provide me with an example? The function I am using to check if the URL is valid is called: is_valid_url and the phrase that everything is located in is called $find[pagetext]. Trying to extract data from strings is something that always confused me as well as for loops. Link to comment https://forums.phpfreaks.com/topic/235310-need-some-help-with-some-string-extraction/#findComment-1209250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.