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

From: Date: Thu, 08 Mar 2007 19:46:02 +0000
Subject: Re: I almost get what you're saying...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-250118@lists.php.net to get a copy of this message
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/

« previous php.general (#250118) next »