Skip to content

Instantly share code, notes, and snippets.

@privatehosting
Created April 25, 2014 00:15
Show Gist options
  • Save privatehosting/11273916 to your computer and use it in GitHub Desktop.
Save privatehosting/11273916 to your computer and use it in GitHub Desktop.
getNextAbc
<?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