JAY BHARAT, software enginer, php programmers, software engineer, jay bharat ,9844542127
palindrome code in php
METHOD1:
<?php //madam aibohphobia Malayalam $word="Malayalam"; $word=strtoupper($word); $len=strlen($word); $first=substr($word,0,($len/2)); $word=strrev($word); $second=substr($word,0,($len/2)); if($first==$second) { echo "Palindrome"; } else { echo "Not Palindrome"; } ?>
METHOD2:
<?php //madam aibohphobia Malayalam $word="Malayalam"; $word=strtoupper($word); $first=$word; $second=strrev($word); if($first==$second) { echo "Palindrome"; } else { echo "Not Palindrome"; } ?>
This is nice one….. Very simple & nice one….. This same program can we do with out using strings library function???
Name (required)
EMail (will not be published) (required)
Website