Last active
February 22, 2017 18:33
-
-
Save johnabela/292e198396234b03461501cdce9d2d8f to your computer and use it in GitHub Desktop.
[PHP] Are All Characters Identical?
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
$word = 'dddddd'; | |
if (empty(str_replace(mb_substr(trim($word),-1),'',trim($word)))) { | |
die('all the characters are identical'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment