if possible please give/show me different ways.
Enter your PHP question at the top of this page and click Get An Answer.
Tell us how quickly you want your PHP question answered.
Connect with your programmer via online chat or telephone call.
if possible please give/show me different ways.
if you want to debug your data and want to its value for development purposes than use:
print_r($your_array);
OR
var_dump($your_data);
and if you want to show it to any user than loop and your logic,
Here you can use, while,for or foreach loop.
here is a example with for loop:
<?php
/* 2 dimensional array in PHP - strictly an
array of arrays ... setup: */
for ($k=1;$k<=10;$k++) {
for ($j=1;$j<=10;$j++) {
$multable[$k][$j] = $j/$k;
}}
# ---------------------------------------------
?>
<html>
<head>
<title>An array of arrays in PHP</title>
</head>
<body bgcolor=white>
<h2>Two dimensional array</h2><br>
<table border=2 cellpadding=2 cellspacing=2>
<?php
/* Very easy to produce a table from a 2D array! */
for ($k=1;$k<=10;$k++) {
print "<tr>";
for ($j=1;$j<=10;$j++) {
echo "<td>",$multable[$j][$k],"</td>";
}
print "</tr>";
}
?>
</table>
</body>
</html>
thanks for clarification and nice answer.
Byron Narciso
Programmer
Whether you have a quick question while preparing your taxes, troubleshooting a computer problem, or need to hire an attorney, ExpertHelp is the most convenient and affordable way to connect with the right service professional to get the job done.
ExpertHelp has been in business since 2011, is an A+ Rated Better Business Bureau accredited member, and offers a 100% satisfaction guarantee on every question you ask!