Thread: whats 0:
View Single Post
Old 01-22-2003, 03:49 PM   #1 (permalink)
Ilya020
Techno Rat
 
Ilya020's Avatar
 
Join Date: Jan 2003
Location: San Diego
Posts: 559
Ilya020 is on a distinguished road
Send a message via AIM to Ilya020
whats 0:

Hey guys,
for a website, I am making an array:
PHP Code:
<?php
$title
="Lists";
include(
"./header.php");
print 
"These are our lists;";
$lists= array(
    array(
"log"=>"blah""foo"),
    array(
"list"=>"fa""blah")
    );
foreach(
$lists as $val)
    {
    foreach(
$val as $key=>$fin_key)
        {
        print 
"<br />$key:<br />$fin_key<br />";
        }
    print 
"<br />";
    }


include(
"./footer.php");
?>
When I try this, I get this:



Lists

These are our lists;
log:
blah

0:
foo


list:
fa

0:
blah

I was wondering, why do I get "0:" in there?

Ilya

EDIT: I know that using the foreach is more C style than PHP...O well!
__________________
> SELECT * FROM users WHERE clue > 0
0 rows returned
Ilya020 is offline   Reply With Quote