Re: Combining two variables...

From: Date: Wed, 04 Aug 2004 16:26:31 +0000
Subject: Re: Combining two variables...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-192725@lists.php.net to get a copy of this message
* Thus wrote Tristan.Pretty@risk.sungard.com: > I'm trying to create a links page, and I wanna filter by category. > Anyhoo, > What I need to do, is have one block of code that I repeat ad neaseum, based on each category, > so if I adda new category, I don't need to add new code... > > All good so far. > So I have a variable $show_links but I wanna change that slightly each time to include the > category name.. eg: > $show_links_$category ${'show_links_' . $category} you'd be better off building a variable $show_links as an array $show_links[$category] Much easier to understand what your doing. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid!

« previous php.general (#192725) next »