Jump to content

STRPOS not working per W3S documentation


Recommended Posts

Posted (edited)

Can someone tell me what I'm doing wrong?
    I believe it's correct code but it doesn't work.

   I get FOUND no matter what I have in $newnum.

    else{print("NOT FOUND");}

Thank you

Edited by mickeymouse
Link to comment
Share on other sites

I just tested your code and it seemed to be working properly. With $newnum="20" it prints "NOT FOUND".

Which values of $newnum did you test with?

I would check the value of $numpos with the var_dump() function to see what its value is. That will tell you where in the string it found the number.



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
  • Create New...