List Info

Thread: note 68504 added to ref.strings




note 68504 added to ref.strings
user name
2006-07-30 10:16:42
Here's an easier way to find nth...

function nth($numbex){
  if ($numbex%10 == 1 && $numbex%100 != 11)
$sth='st';
  elseif ($numbex%10 == 2 && $numbex%100 != 12)
$sth='nd';
  elseif ($numbex%10 == 3 && $numbex%100 != 13)
$sth='rd';
  else $sth = 'th';
  return $sth;
}

there is is no need to check if the user has entered a
non-integer as we may be using this function for expressing
variables as well eg. ith value of x , nth root of z ,etc...
----
Server IP: 81.92.200.26
Probable Submitter: 221.128.144.206
----
X-Spam-Status: No, hits=3.1 required=5.0
tests=DATE_MISSING,FROM_NO_LOWER 
	autolearn=no version=2.64
----
Manual Page -- http://w
ww.php.net/manual/en/ref.strings.php
Edit        -- http://master.p
hp.net/note/edit/68504
Del: integrated  -- ht
tp://master.php.net/note/delete/68504/integrated
Del: useless     -- http:
//master.php.net/note/delete/68504/useless
Del: bad code    -- http
://master.php.net/note/delete/68504/bad+code
Del: spam        -- http://m
aster.php.net/note/delete/68504/spam
Del: non-english -- h
ttp://master.php.net/note/delete/68504/non-english
Del: in docs     -- http:
//master.php.net/note/delete/68504/in+docs
Del: other reasons-- http://master
.php.net/note/delete/68504
Reject      -- http://master
.php.net/note/reject/68504
Search      -- http://ma
ster.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )