Re: Stupid array question

From: Date: Sat, 18 Aug 2001 13:00:03 +0000
Subject: Re: Stupid array question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1356@lists.php.net to get a copy of this message
Hello Mike, This array is obtained form a xml file and id is .. a id the I set up myself manually so I'm sure that id contain something (that i controlled by a print_r) The print_r ($myarray) gives : _______________________________________ Array (
    [1] => Array
        (
            [paragraph_id] => 1
            [paragraph_title] => foo tile 1
            [paragraph_chapo] => foo chapo 1
            [paragraph_text] =>  foo text 1
        )
    [2] => Array
        (
            [paragraph_id] => 2
            [paragraph_title] => foo title 2
            [paragraph_chapo] => foo chapo 2
            [paragraph_text] => foo text 2
        )
) ___________________________________________ The xml file is like this : <paragraph id="1">
        <title><![CDATA[foo title]]></title>
        <chapo><![CDATA[foo chapo]]>]]></chapo>
        <text><![CDATA[ foo text ]]></text>
</paragraph> <paragraph id="n">
        <title><![CDATA[foo title n]]></title> and so on
Luc At 14:06 18/08/01 +0200, Mike Krus wrote:
Luc Saint-Elie wrote:
I'd like to try : foreach ( ...... ) { $id = $t['id'];
$myarray[$id]['category']     = $category;
$myarray[$id]['version]      = $version; and so on....
to use {section} on $myarray, it needs to be a continuous array (0...n). Maybe $t['id'] is does not return continuous indices.... Mike


« previous php.smarty.general (#1356) next »