Last active
November 18, 2022 06:39
-
-
Save iods/9ee7922d294b832759ea67845059e5c3 to your computer and use it in GitHub Desktop.
[Magento 2] Catalog Helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isPalindrome($text) { | |
$text = preg_replace('/[^a-zA-Z]/', '', $text); | |
$text = strtolower($text); | |
if (strrev($text) == $text) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isPalindrome($text) { | |
$text = preg_replace('/[^a-zA-Z]/', '', $text); | |
$text = strtolower($text); | |
if (strrev($text) == $text) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment