public function compareLength($stringOne, $stringTwo) {
    $lengthOne = strlen($stringOne);
    $lengthTwo = strlen($stringTwo);
    if ($lengthOne > $lengthTwo) {
      return -1;
    } elseif ($lengthOne < $lengthTwo) {
      return 1;
    } else {
      return strcmp($stringOne, $stringTwo);
    }
  }
public function compareLength($stringOne, $stringTwo) {
    $lengthOne = strlen($stringOne);
    $lengthTwo = strlen($stringTwo);
    if ($lengthOne > $lengthTwo) {
      return -1;
    } elseif ($lengthOne < $lengthTwo) {
      return 1;
    } else {
      return strcmp($stringOne, $stringTwo);
    }
  }
public function compareLength ( $ stringOne , $ stringTwo ) { $ lengthOne = strlen ( $ stringOne ) ; $ lengthTwo = strlen ( $ stringTwo ) ; if ( $ lengthOne > $ lengthTwo ) { return - 1 ; } elseif ( $ lengthOne < $ lengthTwo ) { return 1 ; } else { return strcmp ( $ stringOne , $ stringTwo ) ; } }
Compare string by length, longer strings first

@param string $stringOne
@param string $stringTwo
@return integer
Compare string by length longer strings first