Mega Code Archive

 
Categories / Php / Strings
 

Strpos() function finds the position of the first occurrence in string

Its syntax is: int strpos (string string, string occurrence [, int offset]) offset specifies the position at which to begin the search.  <? $log = "1999-01-31"; $pos = strpos($log, "1999"); print $pos; ?>