what I have to change to this part will work?
$array4Midfeld = array('$LM', '$DMEins', '$DMZwei', '$RM');
$array4Midfield[0] = "Test";
At the moment I get an error, regarding to the second line. Error is... $LM not defined.
what I have to change to this part will work?
$array4Midfeld = array('$LM', '$DMEins', '$DMZwei', '$RM');
$array4Midfield[0] = "Test";
At the moment I get an error, regarding to the second line. Error is... $LM not defined.
There is spelling mistake in array name on line number 2. You have created array with $array4Midfeld name and accessing it with $array4Midfield name on line number 2. That's why you are getting error. try following code, It is working.
<?php
$array4Midfield = array($LM, $DMEins, $DMZwei, $RM);
$array4Midfield[0] = "Test";
print_r($array4Midfield);
?>
' should not be there (because all are variables there). i removed it. Correct it if i am wrong.You have two problems with this:
Are you assigning variables as elements of the array? (ie $LM, $DMZwei, etc), or are they text? "$LM", "$DMZwei"
Your variables are not the same. Line 1 and Line 2 are two different vars: array4Midfeld and array4Midfield, are they supposed to be the same?
So are you testing that
`$array4Midfield[0] = "Test"
or
`$array4Midfield[0] = $LM
or
$LM = "Test"
Please assign Values to an array in this form. More over the array name too, am confuse whether they are the same or not. $array4Mittelfeld or $array4Midfield
$array4Mittelfield[0] = $LM;
$array4Mittelfield[1] = $DMEins;
$array4Mittelfield[2] = $DMZwei;
$array4Mittelfield[3] = $RM;
echo $array4Mittelfield[0];
or you can use loop to print all the values
Hope it helps