something like that is the goal
$prueba=array(patron=>'',usuario=>'')
in order to fill with values in subsequent operations. How can I do this properly? Thanks.
something like that is the goal
$prueba=array(patron=>'',usuario=>'')
in order to fill with values in subsequent operations. How can I do this properly? Thanks.
To complement the answer of Federico Saenz
that is correct, I will detail a little about the use of arrangements.
First of all, depending on the version of PHP you are using, you can define an arrangement like this:
$arreglo = array('patron'=>,'usuario'=>);
or so from PHP 5.4
$arreglo = ['patron'=>,'usuario'=>];
Now once you have defined you can check the value of the keys created
var_dump($arreglo['patron']) //Retorna NULL
var_dump($arreglo['usuario']) //Retorna NULL
You can also modify the value assigned to the keys
$arreglo['patron'] = 666;
$arreglo['usuario'] = 'NekoOS';
I have even added more associations
$arreglo['nuevo'] = 'dato insertado previamente';
You could print the entire arrangement on the screen
print_r($arreglo['usuario']);
/**
Tendrías un resultado así:
Array
(
[patron] => 666
[usuario] => NekoOS
[nuevo] => dato insertado previamente
)
*/
You can find more information about the use of arrangements and functions to operate with fixes in the official PHP page, here you have two links that could be useful:
Yes, you can. But remember to put the quotes to the keys so that they are of the string type.
$prueba = array('patron'=>'','usuario'=>'');
Greetings.