I am a newbe so maybe stupid question.. I have a couple of variables:
$opleidingscode1 = rgar( $entry, '31'); //$Opleidingssoortcode
$opleidingscode2 = rgar( $entry, '32'); //$Opleidingssoortcode
$opleidingscode3 = rgar( $entry, '33'); //$Opleidingssoortcode
$opleidingscode4 = rgar( $entry, '34'); //$Opleidingssoortcode
$opleidingscode5 = rgar( $entry, '35'); //$Opleidingssoortcode
Then put them in an array:
$array = array( $opleidingscode1,$opleidingscode2,$opleidingscode3,$opleidingscode4,$opleidingscode5 );
Because only one variable has a value, rest is empty, i want to return only the value. So now i have:
$arrlength = count($array);
$string = "";
for($x = 0; $x < $arrlength; $x++) {
$string = $array[$x];
break; }
But it only returns a value if the last variable of the array has a value ($opleidingscode5)
What am i doing wrong?