By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

Documentation on strpos

P: n/a
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.
Feb 9 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Dana Cartwright wrote:
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.
To me, it's indeed an obsolete remark, as the changed behaviour only applies
to strrpos().

It's probably mentioned, however, to prevent confusion for pre-PHP 5 users
who might think that both strpos() and strrpos() behave the same.
JW
Feb 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.