Antivirus
05 Jun 2007, 16:07
Having trouble testing strpos below:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
It's returning true because the '1' is within the haystack (11,20) however i only want it to return true if the needle is '11', not 1. Is there a different function i should be using to test for a numeric value within a string?
Thanks!
solved... needed to encapsulate the needle and haystack then do the strpos check, as follows:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
:)
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
It's returning true because the '1' is within the haystack (11,20) however i only want it to return true if the needle is '11', not 1. Is there a different function i should be using to test for a numeric value within a string?
Thanks!
solved... needed to encapsulate the needle and haystack then do the strpos check, as follows:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
:)