fork(12) download
  1. <?php
  2.  
  3. $text = 'шшшшшш';
  4. $text = trim($text);
  5. echo strcasecmp($text, strrev($text)), PHP_EOL;
  6.  
  7. function mb_strcasecmp($str1, $str2, $encoding = null) {
  8. if (null === $encoding) {
  9. $encoding = mb_internal_encoding();
  10. }
  11. return strcmp(mb_strtolower($str1, $encoding), mb_strtolower($str2, $encoding));
  12. }
  13.  
  14. function utf8_strrev($str){
  15. preg_match_all('/./us', $str, $matches);
  16. return join('', array_reverse($matches[0]));
  17. }
  18.  
  19. echo mb_strcasecmp($text, utf8_strrev($text));
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
73
0