Documentation on strpos



At php.net, the following paragraph is the first thing in the definition of
strpos:

"Returns the numeric position of the first occurrence of needle in the
haystack string. Unlike the strrpos() before PHP 5, this function can take a
full string as the needle parameter and the entire string will be used."

I find the reference to "strrpos" confusing, coming this early in the
definition. This is the definition of strpos, not strrpos. That is, the
paragraph would make a lot more sense if it read:

"Returns the numeric position of the first occurrence of needle in the
haystack string."

Dragging in "strrpos", which used to have a restriction on "needle", seems
pointless, and worse, confusing.

But, before I report this as a problem, I'd appreciate some feedback on
this. If I'm the only person who finds this confusing, I'll just go away
and be quietly confused.


.



Relevant Pages

  • Re: Implementing strstr
    ... that string doesn't appear at all). ... const char* strstr(const char* haystack, const char* needle) ...
    (comp.programming)
  • RE: Currency Field Format Correction
    ... Function SF_removeAllOnce(ByVal Haystack As String, ByVal Needle As String) ... Fieldname]) and run the query. ...
    (microsoft.public.access.modulesdaovba)
  • Re: PHP global namespace clogged up
    ... -string strchr(string haystack, string needle) ... int strpos(string haystack, string needel ): ...
    (comp.lang.php)
  • Re: need some help
    ... a pointer to the first occurrence of 1st string in 2nd string or NULL ... char *ashstrstr(char *haystack, char *needle) ... It should be strstr(needle, haystack). ... the student to write the internals of strstr. ...
    (comp.lang.c)
  • Re: the lowest number of comparisons in string matching
    ... A needle of length n can't begin after position m-n in the haystack. ... character comparisons.) ... (This stuff /is/ confusing. ...
    (comp.programming)