Last active
September 27, 2021 15:54
-
-
Save ialexpw/8b26023071a0e4b8aad35a448ee483ee to your computer and use it in GitHub Desktop.
Example
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 | |
// For PHP 8+ | |
foreach ($argv as $arg) { | |
if (str_contains($arg, '=')) { | |
list($arg_x, $arg_y) = explode('=', $arg); | |
$_GET[$arg_x] = $arg_y; | |
} | |
} | |
// For PHP < 8 | |
foreach ($argv as $arg) { | |
if (strpos($arg, '=') !== false) { | |
list($arg_x, $arg_y) = explode('=', $arg); | |
$_GET[$arg_x] = $arg_y; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment