fork(1) download
  1. <?php
  2.  
  3.  
  4. $text="А роза упала на лапу Азорра";
  5. $result="палиндром";
  6. $minitext=mb_strtolower($text);
  7. $repl_text=str_replace(" ", "", $minitext);
  8. $array_text=preg_split('//u', $repl_text, null, PREG_SPLIT_NO_EMPTY);
  9. $array1=array_reverse($array_text);
  10. $results=array_diff($array_text, $array1);
  11. print_r($results);
  12.  
  13. if ($result<=0) {
  14.  
  15. echo "$result";
  16. }
  17. else {
  18. echo "ошибка";
  19. }
  20.  
  21.  
  22. #$minitext=mb_strtolower($text);
  23. #$repl_text=str_replace(" ", "", $minitext);
  24. #echo "$repl_text";
  25. #$array_text=str_split($repl_text);
  26. #$array_reverse=array_reverse($array_text);
  27. #print_r($text);
  28.  
  29.  
Success #stdin #stdout 0.02s 25468KB
stdin
Standard input is empty
stdout
Array
(
)
палиндром