#26352 [NEW]: strpos() webpage missing an example for the use of offset attriubte
| From: | scott at abcoa dot com | Date: | Fri, 21 Nov 2003 16:47:24 +0000 |
| Subject: | #26352 [NEW]: strpos() webpage missing an example for the use of offset attriubte | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-22139@lists.php.net to get a copy of this message | ||
From: scott at abcoa dot com
Operating system:
PHP version: Irrelevant
PHP Bug Type: Website problem
Bug description: strpos() webpage missing an example for the use of offset attriubte
Description:
------------
Read the strpos() function at
http://us3.php.net/manual/en/function.strpos.php
and had some trouble with
it for a while, it took me a while to better understand it because I never
use this function before. There are two problem here.
Problem #1: The word 'offset' is a bad choice of word because the
definition of it can be anything to what anyone's interpretation of the
definition. Like mine, I assumed that offset meant to cancel each other
out but when playing around with the script, I then knew that is not what
it meant so I had no idea of what it meant. This problem can be overcome
by the Problem #2.
Problem #2: There is no example script of a strpos() with the use of
offset attribute. So, how about updating the webpage to include the
example. That would help to reduce the confusion and struggling in the
long run. An example of it would be like this but don't take my word for
it and you can use a simplier example
--
$res_str = "blah blah blah blah";
$XML_Start = (strpos($res_str,"<![CDATA[")+9);
$HTML_Start = (strpos($res_str,"<![CDATA[",$XML_Start)+9);
$HTML_End = strpos($res_str,"]]>",$HTML_Start);
$XML_End = strpos($res_str,"]]>",$HTML_End);
--snip--
Thanks!!
--
Edit bug report at http://bugs.php.net/?id=26352&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26352&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26352&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26352&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26352&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26352&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26352&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26352&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26352&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26352&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26352&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26352&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26352&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26352&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26352&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26352&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26352&r=float