This is killing me, for the life of me i can not seem to figure out how to get this to work, or why it doesn't work in the first place.
Here is what i'm trying to do:
here is my variables declaration:
$locale = 'US';
$realm = 'magtheridon';
$character = 'billymayys';
here is my array declaration:
$my_array = ( 'L' => $locale, 'R' => $realm, 'C' => $character );
I am new to php and from what i can tell this should create an array who would print out to:
Array(
[L] => US,
[R] => magtheridon,
[C] => billymayys,
);
But it doesn't.
What is the proper way to create an array, whos index i can name and then assign variables to the values of those indexs?
The array declaration:
$my_array = ( 'L' => 'US', 'R' => 'magtheridon', 'C' => 'billymayys' );
Works but i do not understand why i cannot dynamically assign the values using variables.
Please help! Thanks.
$my_array = array('L' => $locale, 'R' => $realm, 'C' => $character );
? – Fabien Apr 11 at 19:52