Palindrome : php

Image source : https://www.grammarly.com/blog/16-surprisingly-funny-palindromes/ Words, numbers, digits, or ... anything, that remain the same as original if we reverse them are Palindromes. So how could we find if a word or a sentence is palindrome or not? We will use php for this... code: <?php function semiPermeableMembrain ( $str ){ $str = strtolower( $str ); $split = str_split ( $str ); foreach ( $split as $obstacle ){ if ( $obstacle == " " || $obstacle == "'" || $obstacle == "." || $obstacle == "," || $obstacle == ";" || $obstacle == ":" || $obstacle == "-" ) { $obstacle = "/ $obstacle /" ; $str = preg_replace ( $obstacle , '' , $str ); } } palindrome( $str ); ...