Ok I have mad up a dummy array which resembles some of the data in the real array.
I have tried putting in the count code as posted above and I get
Code:
Parse error: parse error, unexpected $ in /var/www/virtual/qoc.lan/test.php on line 46
PHP Code:
<?php
$data =
array ( order =>
array(standardctrls =>
array(txtcontrol =>
array( 1 =>
"array([id]=>Name_First,[caption]=>Firstname:,[value]=>Joe)",
"array([id]=>Name_Last,[caption]=>Lastname:,[value]=>Bloggs')",
"array([id]=>Street,[caption]=>Street:,[value]=>1 My Street)"
)
)
)
);
$array_count = count($data['order'][0]['standardctrls'][0]['txtcontrol']);
$stepp = -1;
while(++$stepp < $array_count)
{
extract($data['order'][0]['standardctrls'][0]['txtcontrol'][$array_count]);
switch ( $id )
{
case 'Name_First':
$Fname_label = $caption;
$Fname = $value;
break;
case 'Name_Last':
$Lname_label = $caption;
$Lname = $value;
break;
case 'Street':
$street_label = $caption;
$street = $value;
break;
}
echo "$firstnamelbl $firstname <br>"
."$Lname_label $Lname <br>"
."$street_label $street";
?>
Anyone have any ideas?
Bookmarks