Re: I almost get what you're saying...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rob Gould wrote:
Myron,

Thank you thank you! You've pointed me in the right direction - - - - but I'm so new to PHP that I need just a "little more" pointing....

From reading the docs, I understand that I need to pull from an associative array, and you are correct that "$venuecity = $attrs['venuecity']". I'm just a little lost as to where I use this knowledge in the below code. Do I need to create a new function-call to focus on pulling out associative arrays, or can I just use $attrs['venuecity'] somewhere below? If I could ask you to help me with just one array, I'm sure I can figure out the rest.


<?php

$insideitem = false;
$tag = "";
$eventname = "";
$venuename = "";
$venuecity = "";

function startElement($parser, $name, $attrs) {
    global $insideitem, $tag, $eventname, $venuename, $venuecity;
    if ($insideitem) {
        $tag = $name;
} elseif ($name == "RESULT") {
        echo "found result";
        $insideitem = true;
    }
}

You get the attributes array right here in startElement$parser, $name, $attrs) :

function startElement($parser, $name, $attrs) {
   global $insideitem, $tag, $eventname, $venuename, $venuecity;

    /if(isset($attrs['venuecity'])) {
       $venuecity = $attrs['venuecity'];
      }
    // etc.

}


_________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux