function tripal_sort_key_length_asc
2.x tripal_core.chado_nodes.title_and_path.api.inc | tripal_sort_key_length_asc($a, $b) |
3.x tripal_core.chado_nodes.title_and_path.inc | tripal_sort_key_length_asc($a, $b) |
Sorts an associative array by key length where sorter keys will be first
This is a uksort callback and shouldn't be called directly. To use; uksort($arr, 'tripal_sort_key_length_asc');
1 string reference to 'tripal_sort_key_length_asc'
- chado_node_get_unique_constraint_format in tripal_core/
api/ tripal_core.chado_nodes.title_and_path.api.inc - Generate the unique constraint for a given base table using the Chado Schema API definition
File
- tripal_core/
api/ tripal_core.chado_nodes.title_and_path.api.inc, line 1533 - Contains API functions to set titles and paths for all chado nodes
Code
function tripal_sort_key_length_asc($a, $b) {
if (strlen($a) == strlen($b)) {
return 0;
}
elseif (strlen($a) > strlen($b)) {
return 1;
}
else {
return -1;
}
}