Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb/web234/b2344/sl.harringtonweb/public_html/pmwiki2.php:2) in /hermes/bosweb/web234/b2344/sl.harringtonweb/public_html/pmwiki2.php on line 1570

Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web234/b2344/sl.harringtonweb/public_html/pmwiki2.php:2) in /hermes/bosweb/web234/b2344/sl.harringtonweb/public_html/pub/skins/simple/simple.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web234/b2344/sl.harringtonweb/public_html/pmwiki2.php:2) in /hermes/bosweb/web234/b2344/sl.harringtonweb/public_html/pmwiki2.php on line 866
Harrington Web : Ben - Palindrome

Palindrome

One of the first kinds of programs learned by a student is how to determine if a string is a palindrome. A palindroms is a word or string that is spelled the same backwords as it is forwards. An example would be "rotor".

<?php
    $test="rotor";
    if ($test == strrev($test)) {
          echo "This is a palindrome";
        } else {
        echo "This is NOT a palindrome";
        }
?>

Some example of some palindromes can be found at www.palindromelist.com

 
Page last modified on June 07, 2006, at 07:21 PM.