You are here

function comment_alter_cmp in Comment Alter 8

usort comparison function.

http://php.net/manual/en/function.usort.php

1 string reference to 'comment_alter_cmp'
_comment_alter_cleanup_field_values in ./comment_alter.module
Helper function to clean up field values for comparison.

File

./comment_alter.module, line 277
Allows to alter entities from comment form.

Code

function comment_alter_cmp($a, $b) {
  if ($a['_weight'] == $b['_weight']) {
    return 0;
  }
  return $a['_weight'] < $b['_weight'] ? -1 : 1;
}