Echo Array Related issues

Source: Internet
Author: User
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 "

";
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.