Last active
April 16, 2021 08:44
-
-
Save codetot/c82dcf88756773a48ee5e8f5f02576f7 to your computer and use it in GitHub Desktop.
Revisions
-
codetot-tech revised this gist
Apr 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,4 @@ preg_match('/(WordPress\/\d\.\d.\d;)[ ]{1,}(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?((?:[\w-]+\.)+[\w-]+)/', $request_user_agent, $matches); var_dump($matches[3]); // domain.com -
codetot-tech created this gist
Apr 16, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ <?php // Example User-Agent: WordPress 5.7.1; http://domain.com $request_user_agent = $_SERVER['HTTP_USER_AGENT'] ?? false; preg_match('/(WordPress\/\d\.\d.\d;)[ ]{1,}(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?((?:[\w-]+\.)+[\w-]+)/', $request_user_agent, $matches); var_dump($matches[3]);