The list () function in PHP is used to assign a value to a set of variables in one operation.
note:The array variable here can only be a numerically indexed array.It is also assumed that the numeric index starts at 0.
list () function definitionThe following:
list (var1, var2 ...)
var1 is required. The first variable to be assigned.
var2, ... Optional. More variables that need to be assigned.
Sample codeThe following:
<?php //$arr=array ("name" =>"tom", "pwd" =>"123456");//Error! The index must be numeric! //$arr=array ("1" =>"tom", "2" =>"123456");//Error! The numeric index must start at 0! $arr=array ("tom", "123456"); list ($name, $pwd)=$arr; echo "welcome". $name. "! remember your password:". $pwd; ?>
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- xcode - pod install [!] no `podfile 'found in the project directory
- dart - flutter: the instance member'stars' can't be accessed in an initializer error