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.

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.