Ejemplo n.º 1
0
/**
 * UTF-8 aware replacement for strcasecmp().
 *
 * Case-insensitive comparison.
 *
 * Returns an integral value indicating the relationship between the strings.
 *
 * - A zero value indicates that both strings are equal.
 * - A value greater than zero indicates that the first character that does not
 * match has a greater value in $str than in $otherstr.
 * - And a value less than zero indicates the opposite.
 *
 * @param  string $str      The UTF-8 encoded string
 * @param  string $otherstr Other UTF-8 encoded string
 * @return int
*/
function utf8_icompare($str, $otherstr)
{
    return utf8_compare($str, $otherstr, true);
}
Ejemplo n.º 2
0
 /**
  * @dataProvider providerUtf8Compare
  */
 public function testUtf8Compare($str, $otherstr, $rv)
 {
     $this->assertEquals(utf8_compare($str, $otherstr), $rv);
 }