Jump to content

Strpos Errors


clonetrooper9494
 Share

Recommended Posts

I was using StrPos to search a very long string, and when I searched for a string, and a different string using StrPos, they both returned the exact same position, 2977. None of this makes any sence, why is it returning the same position for 2 different strings? My first thought is that the input was just too long for the function to search through, but I am not sure. If you need me to post the source code and a link to the very large file i was inputing, just ask.

Link to comment
Share on other sites

If you're using the second strpos within the first one, it won't work because strpos stops as soon as it finds a match, I think. If you're swapping the string to search for, then it's a bit strange.

Link to comment
Share on other sites

I don't understant what you mean by "using the second strpos within the first one", but here is the part of the code I'm referring to:

  echo strpos($input,$start)."\n<br>\n";  echo strpos($input,$end)."\n<br>\n";

when I put the value of $input in notepad and press CTRL+F, I can find both $start and $end, but this script returns29772977

Edited by CloneTrooper9494
Link to comment
Share on other sites

I don't understant what you mean by "using the second strpos within the first one", but here is the part of the code I'm referring to:
  echo strpos($input,$start)."\n<br>\n";  echo strpos($input,$end)."\n<br>\n";

when I put the value of $input in notepad and press CTRL+F, I can find both $start and $end, but this script returns29772977

Did you check to see if $start and $end are the same string?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...