Jump to content

Need Some Help With Some String Extraction


TheMayhem

Recommended Posts

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.