Skip to content

Instantly share code, notes, and snippets.

@ialexpw
Last active September 27, 2021 15:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Example
<?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