Created
February 3, 2021 06:41
-
-
Save mohsin/f484be2eddd7ad896fcc55b746c97bbf to your computer and use it in GitHub Desktop.
Postman Galaxy Event Quiz PHP script for solving the word search puzzle
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 characters
<?php | |
// Use php 8.0 for str_contains | |
$arrays = [ | |
'vvtazcszriaudu', | |
'aoejmmwtfwteoo', | |
'responsertyanr', | |
'iytycuyabrfxtx', | |
'avwlkcmmonitor', | |
'bijbsufmeqkwtp', | |
'lqhqlwdmurpbrm', | |
'eimtulchugildk', | |
'variable', | |
'voeyviqi', | |
'testwjhm', | |
'ajpylbqt', | |
'zmockslu', | |
'cmnucuwl', | |
'swsymfdc', | |
'zteammmh', | |
'rfrboeuu', | |
'iwtrnqrg', | |
'atyfikpi', | |
'ueaxtwbl', | |
'dontotrd', | |
'uorxrpmk' | |
]; | |
$contents = file_get_contents('dictionary.txt'); // Use a dictionary file or alternatively crawl/raid the postman docs and wordify it | |
$words = explode("\n", $contents); | |
foreach ($words as $word) { | |
if (strlen($word) > 3) { | |
foreach ($arrays as $randomized) { | |
if (str_contains($randomized, $word) || str_contains($randomized, strrev($word))) { | |
echo sprintf("%s contains: %s\n", $randomized, $word); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment