note 115933 added to function.range
| From: | unicod3 at hotmail dot com | Date: | Wed, 15 Oct 2014 17:43:16 +0000 |
| Subject: | note 115933 added to function.range | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200660@lists.php.net to get a copy of this message | ||
a function to get column index by letter
function getColumnNumber($char){
$alphabet = range('a','z');
$alphabet2 = range('a','z');
$newAlphabet = $alphabet;
foreach($alphabet as $k => $r)
{
foreach($alphabet2 as $row){
$newAlphabet[] = $r.$row;
}
}
$key = array_search($char, $newAlphabet);
return ($key !== false) ? $key : null;
}
----
Server IP: 72.52.91.14
Probable Submitter: 50.242.13.201
----
Manual Page -- http://php.net/manual/en/function.range.php
Edit -- https://master.php.net/note/edit/115933
Del: integrated -- https://master.php.net/note/delete/115933/integrated
Del: useless -- https://master.php.net/note/delete/115933/useless
Del: bad code -- https://master.php.net/note/delete/115933/bad+code
Del: spam -- https://master.php.net/note/delete/115933/spam
Del: non-english -- https://master.php.net/note/delete/115933/non-english
Del: in docs -- https://master.php.net/note/delete/115933/in+docs
Del: other reasons-- https://master.php.net/note/delete/115933
Reject -- https://master.php.net/note/reject/115933
Search -- https://master.php.net/manage/user-notes.php