Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function func(string $strStart, string $strEnd) : bool
- {
- $strStartChars = str_split(trim($strStart));
- $strEndChars = str_split(trim($strEnd));
- $strStartChars = array_diff($strStartChars, [' ']);
- $strEndChars = array_diff($strEndChars, [' ']);
- foreach( $strStartChars as $char )
- {
- if( in_array($char, $strEndChars) )
- unset($strEndChars[array_search($char, $strEndChars)]);
- else
- return false;
- }
- return count($strEndChars) == 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement