PHP question

Brian D quiet_celt at yahoo.com
Mon Apr 5 00:34:03 CDT 2004


--- Don Erickson wrote:
> Brian D wrote:
> 
> > echo '<td><a
> >
>
href="'.$DYN_menu[$i]->URL.'">'.$DYN_menu[$i]->TITLE.'</a>&nbsp;
> > |&nbsp;&nbsp;</td>'; 
> 
> 
> 
> For starters, variables between single tics don't
> get expanded in php.
I know, that is why I'm using the periods.

> So, you need to use double quotes on the echo
> command.  Just escape the 
> quotes that you need to keep the html from breaking
> out on spaces. 
Same effectthough as my method

> Also, I don't know what the "->" in your code does,
> but I see what it is 
> supposed to do.  Does this really work in
> associative arrays?  I've not 
> seen it before.
DYN_menu is an object.

class dyn_menu { 
     function dyn_menu($title, $vtitle, $width, $url,
$target) { 
        $this->TITLE = $title; 
	$this->VTITLE = $vtitle; 
	$this->WIDTH = $width; 
	$this->URL = $url; 
	$this->TARGET = $target; 
    } 
} 
> 
> I'd try something like:
> 
> 
> while ($DYN_menu[$i]) {
>      foreach ($DYN_menu[$i] as $URL => $TITLE) {
>          echo "<td><a
> href="$URL">$TITLE</a>&nbsp;&nbsp;&nbsp;</td>";
>      }
> $i++;
> }
I'm not sure what you're doing here, but I don't think
this would work for my setup. What are you doing in
this snippet?

Thanks,
Brian

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/




More information about the Kclug mailing list