fork(1) download
  1. <?php
  2.  
  3.  
  4. $text = "A roza upala na lapu Azora";
  5. $result = "palindrom";
  6. $newText = "";
  7. $textLength = strlen($text);
  8.  
  9. for ($i = 0; $i < $textLength; $i++) {
  10. if ($text[$i] != " ") {
  11. $newText = $newText . $text[$i];
  12. }
  13. }
  14. $newText = strtolower($newText);
  15.  
  16. $newTextLength = strlen($newText);
  17.  
  18.  
  19.  
  20. for ($j = 0; $j < $newTextLength; $j++) {
  21.  
  22. $lost = $newText[$newTextLength - 1];
  23. $first = $newText[$j];
  24.  
  25. if ($first != $lost) {
  26. echo "ne palidrom";
  27. } else {
  28. $lost--;
  29. $first++;
  30. }
  31.  
  32.  
  33.  
  34. }
  35. echo "palidrom";
  36.  
  37.  
  38.  
  39.  
  40.  
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
ne palidromne palidromne palidromne palidromne palidromne palidromne palidromne palidromne palidromne palidromne palidromne palidromne palidrompalidrom