php - Why strpos returns false in this case? -


i'm trying find out if string contains string.

here code

$insta_share_link='https://instagram.com/p/bir-knbgyt-';  if(strpos($insta_share_link,'instagram.com/p/')) {  //some code...  } 

when wrote echo function see strpos returning, showed false.

why?

the needle has 'www.', haystack ('https://instagram.com...') not.

the entire string 'www.instagram.com/p/' must found in haystack strpos return position of string.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -