Jump to content
mirelkobra

cautare text intr-un website

Recommended Posts

pe codingforums este un tutorial cu o functie inStr

function inStr ($needle, $haystack)
{
  $needlechars = strlen($needle); //gets the number of characters in our needle
  $i = ;
  for($i=; $i < strlen($haystack); $i++) //creates a loop for the number of characters in our haystack
  {
    if(substr($haystack, $i, $needlechars) == $needle) //checks to see if the needle is in this segment of the haystack
    {
      return TRUE; //if it is return true
    }
  }
  return FALSE; //if not, return false
}  

iar ca sa folosesti functia

 

if(inStr("CodingForums", "The best site ever is CodingForums"))
{
  echo "CodingForums is in this string";
}  

probabil cu un loop /while si php curl poti naviga pe tot siteul si interoga orice pagina astfel incat sa gasesti textul cautat de tine.

good luck!

Link to comment
Share on other sites

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.   Paste as plain text instead

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