Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function check_strings($str1, $str2)
- {
- $str_array1 = str_split($str1);
- $str_array2 = str_split($str2);
- foreach($str_array1 as $key => $value)
- {
- if($value == ' ')
- {
- unset($str_array1[$key]);
- }
- }
- foreach($str_array2 as $key => $value)
- {
- if($value == ' ')
- {
- unset($str_array2[$key]);
- }
- }
- if(array_diff($str_array1, $str_array2) && array_diff($str_array2, $str_array1))
- {
- echo 'false';
- }
- else
- {
- echo 'true';
- }
- }
- check_strings('clockwise', 'owe clicks');
- // check_strings('clockwise', 'clockwork');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement