echo Array problem
while ($row =mysql_fetch_array ($result))
{
List ($x 1, $y 1) = Explode (' | ', $row [' xyz1 ']);
List ($x 2, $y 2) = Explode (' | ', $row [' xyz2 ']);
......
$left =array ($x 1, $x 2, ...);
$top =array ($y 1, $y 2, ...);
}
$notes. = ';
?>
$x 1, $x 2, $y 1, $y 2 The top,left coordinates of the div are stored
But Echo comes out and sees only a div and doesn't get $left, $top value
If I write
'
Or
'
It can be displayed normally
Because I want to echo a lot of Div, so it is impossible to enumerate by myself, how to use a single sentence to all the Div echo out?
Tried to judge with a for
for ($i =0; $i <100; $i + +)
{
echo "
'
";
}
But
'. $left ['. $i. ']. ' Don't know what the right way to say
Other than that
{
List ($x 1, $y 1) = Explode (' | ', $row [' xyz1 ']);
List ($x 2, $y 2) = Explode (' | ', $row [' xyz2 ']);
......
$left =array ($x 1, $x 2, ...);
$top =array ($y 1, $y 2, ...);
}
What methods of this statement can be combined directly into an expression similar to the following
List ($left, $top) =array (Explode (' | ', $row [' xyz1 ']), explode (' | ', $row [' xyz2 ']),...... )
Otherwise, you have to list it by yourself.
------Solution--------------------
Check this out
PHP Code
$ar = Array (' xy1 ' = ' + ', ' xy2 ' = ' 3,4 ', ' xy3 ' = ' 5,6 ', ' xy4 ' = ' 7,8 ',), Array (' xy1 ' = ' 11,12 ') ', ' xy2 ' = ' 13,14 ', ' xy3 ' = ' 15,16 ', ' xy4 ' = ' 17,18 ', '), "foreach" ($ar as $r) foreach ($r as $v) list ($x [ ], $y []) = explode (', ', $v);p rint_r ($x);p rint_r ($y);
------Solution--------------------
echo "";
Or:
echo "