Created
April 25, 2014 00:15
-
-
Save privatehosting/11273916 to your computer and use it in GitHub Desktop.
getNextAbc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param GetAlphapet | |
* @link http://www.asciitable.com/ | |
* @author 2010 PrivateCityPage | |
* @author 2014 Dominik Pilichiewicz | |
*/ | |
function getNextABC($gbuchstabe = false) | |
{ | |
$gbuchstabe = strtolower($gbuchstabe); | |
if($gbuchstabe == false) | |
{ | |
$gbuchstabe = false; | |
} elseif(ord($gbuchstabe) >= 1) | |
{ | |
$gbuchstabe = chr(ord($gbuchstabe)+1); | |
} else | |
{ | |
for ($i=65;$i<=90;$i++) | |
{ | |
$buchstabe = chr($i); | |
if($gbuchstabe == $buchstabe) | |
{ | |
$gbuchstabe = chr($i+1); | |
} | |
} | |
} | |
return $gbuchstabe; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment