note 74639 added to language.operators.increment
| From: | Q1712 at online dot ms | Date: | Sat, 21 Apr 2007 01:52:33 +0000 |
| Subject: | note 74639 added to language.operators.increment | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125728@lists.php.net to get a copy of this message | ||
A more detailed explanation of the string incremant is:
First of all it is checked wether the string is a standart representaion of a number wich is true if
it equals the regex /^ *[+-]?[0-9]*(\.[0-9]|[0-9]\.)[0-9]*([eE]?[+-]?[0-9]+)?$/
but not the regex /\+\./ (no idea why).
if it does, the type is changed to integer (if it equals /^ *[+-]?[0-9]+$/) or to float and then
incremented by one.
An empty string becomes the string "1".
Otherwise if the last character is one of [0-8], [a-y] or [A-Y] it is incremented. If it is Z it
puts it back to A, is z to a, if 9 to 0 and trys to do the same with the previouse character.
If a character is reatched that is not in [0-9a-zA-Z], nothing is done anymore (that's why
" Z" will increment to " A").
If the begining is reached a new caracter is prepended. "1" "a" or "A"
depending on wether the first character was "9", "z" or "Z".
If the last character was not [0-9a-zA-Z] the string isn't chaged.
hope this helps someone
----
Server IP: 69.147.83.197
Probable Submitter: 84.158.116.149
----
Manual Page -- http://www.php.net/manual/en/language.operators.increment.php
Edit -- https://master.php.net/note/edit/74639
Del: integrated -- https://master.php.net/note/delete/74639/integrated
Del: useless -- https://master.php.net/note/delete/74639/useless
Del: bad code -- https://master.php.net/note/delete/74639/bad+code
Del: spam -- https://master.php.net/note/delete/74639/spam
Del: non-english -- https://master.php.net/note/delete/74639/non-english
Del: in docs -- https://master.php.net/note/delete/74639/in+docs
Del: other reasons-- https://master.php.net/note/delete/74639
Reject -- https://master.php.net/note/reject/74639
Search -- https://master.php.net/manage/user-notes.php