PHP8: new str_* function

This commit is contained in:
Sunch 2024-08-17 20:11:55 +08:00
parent 69385e16f2
commit 1275a4558c
7 changed files with 15 additions and 15 deletions

View file

@ -140,7 +140,7 @@ function arguments($args){
foreach($args as $arg){
// Is it a command? (prefixed with --)
if(substr($arg, 0, 2) === '--'){
if(str_starts_with($arg, '--')){
$value = preg_split('/[= ]/', $arg, 2);
$com = substr(array_shift($value), 2);
@ -152,7 +152,7 @@ function arguments($args){
}
// Is it a flag? (prefixed with -)
if(substr($arg, 0, 1) === '-'){
if(str_starts_with($arg, '-')){
$ret['flags'][] = substr($arg, 1);
continue;
}