Skip to content

Instantly share code, notes, and snippets.

@dave-jay
Created July 29, 2014 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dave-jay/6ac4cfa72b080190889c to your computer and use it in GitHub Desktop.
Save dave-jay/6ac4cfa72b080190889c to your computer and use it in GitHub Desktop.
<?php
# code for how to get the new key
$proj_cout = count($projects['departments']);
if(empty($projects['departments'])){
$newKey = 0;
}else{
$keys = array_keys($projects['departments']);
asort($keys);
$newKey = end($keys);
$newKey = $newKey + 1;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment