SHARE
TWEET

Untitled

a guest May 23rd, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. class be_php_1_diskominfo_jabar
  4. {
  5.     public static function isPalindrome($word)
  6.     {
  7.         $length = strlen($word);
  8.         if ($length < 1) {
  9.             return false;
  10.         }
  11.         for ($i=0; $i < $length; $i++) {
  12.             if ( strcmp($word[$i], $word[$length-1-$i])) {
  13.                 return false;
  14.             }
  15.         }
  16.         return true;
  17.     }
  18. }
  19.  
  20. echo (be_php_1_diskominfo_jabar::isPalindrome("onlyyou")) ? 'Ya ini palindrome' : 'Anda belum beruntung, coba lagi!';
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top