Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Date: Fri, 26 Jul 2013 22:04:53 +0200 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 Newsgroups: comp.lang.php Subject: Re: Variable variables? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <3c1bca-p81.ln1@luuk.invalid.lan> Lines: 53 NNTP-Posting-Host: 2001:980:9089:1:8966:4a16:a859:b517 X-Trace: 1374869402 news.xs4all.nl 16008 [2001:980:9089:1:8966:4a16:a859:b517]:56550 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.php:10219 On 26-07-2013 04:56, Scott Johnson wrote: > I have a situation which I 'think' I need to use variable variables and > not sure how to go about it. > > > I have several "; > foreach($category_ary as $c_id=>$category) { > if(in_array($c_id, array of posted value)) { > // Create select option > } else { > // Create regular option > } > } > echo ""; > } > > I hope this makes sense and yes I did RTM but could not transpose what > they where explaining to what I need to do. > > Thanks > Scotty This will return 'test': $a="test"; $b="a"; print ${$b}; so, if $parent="Woman", then ${$parent} should refer to the $Woman[], and if $parent="Mens" then ${$parent} should refer to $Mens[]