Current location: Hot Scripts Forums » Programming Languages » PHP » arrays


arrays

Reply
  #1 (permalink)  
Old 07-24-04, 10:35 AM
jasperma jasperma is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
arrays

What's wrong with this:

PHP Code:

<?php

$products 
= array ( array ( array ("TIR""Tires"100),
                                        array (
"OIL""Oil"10),
                                        array (
"SPA""Spark Plugs"5)
                                        ),
                             array ( array (
"TIR""Tires"100),
                                        array (
"OIL""Oil"10),
                                        array (
"SPA""Spark Plugs"5)
                                        ),
                             array ( array (
"TIR""Tires"100),
                                        array (
"OIL""Oil"10),
                                        array (
"SPA""Spark Plugs"5)
                                        ),
                             );

for (
$layer 0$layer 3$layer++)
{
     echo 
"Layer $layer<br>";
     for (
$row 0$row 3$row++)
     {
          for (
$col 0$col 3$col++)
          {

               echo 
"|".$catagories[$layer][$row][$col];
   
          }
       echo 
"|</br>";
      }
}
?>
it's not displaying as i want it to display, here is the file:

http://www.jumpstartpunk.com/test/Chapter%203/array.php
Reply With Quote
  #2 (permalink)  
Old 07-24-04, 12:27 PM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

echo "|".$catagories 

should be
PHP Code:

echo "|".$products 

Kevin
Reply With Quote
  #3 (permalink)  
Old 07-24-04, 01:31 PM
jasperma jasperma is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
i feel so dumb now
thanks.
Reply With Quote
  #4 (permalink)  
Old 07-24-04, 01:49 PM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
Everybody makes those kinds of mistakes
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrays Greigorama Windows .NET Programming 3 06-17-04 05:13 AM
Going Insane Over Lists and Arrays mtorbin Perl 3 06-03-04 04:19 AM
Help with arrays thevhway PHP 2 05-25-04 04:44 AM
Associative Arrays fxsinus JavaScript 4 03-12-04 09:38 AM
Database queries or arrays ? danux PHP 2 03-11-04 07:57 AM


All times are GMT -5. The time now is 04:14 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.