Created
October 6, 2023 12:34
-
-
Save ZurabWeb/0b8d1c25534b2d340e85819f4b434f2b to your computer and use it in GitHub Desktop.
Code golf 10/6/2023
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 | |
$subdomain = 'a.b.c.d'; | |
$parts = explode('.', $subdomain); | |
$resp = []; | |
while (count($parts) > 0) { | |
$resp[] = implode('.', $parts); | |
array_shift($parts); | |
} | |
print_r($resp); |
Author
ZurabWeb
commented
Oct 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment