Skip to content

Instantly share code, notes, and snippets.

@tranchausky
Created October 10, 2022 02:47
Show Gist options
  • Select an option

  • Save tranchausky/609f85c9ddca8ab885469cab03f99092 to your computer and use it in GitHub Desktop.

Select an option

Save tranchausky/609f85c9ddca8ab885469cab03f99092 to your computer and use it in GitHub Desktop.
php get parameter when run in bash
<?php
//php .\get_param.php 123
if (php_sapi_name() === "cli") {
var_dump($argv[1]);
}else{
exit('Not allow');
}
//123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment