Dynamic Array Vars

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amolbehl
    New Member
    • May 2007
    • 63

    Dynamic Array Vars

    Below $month takes vals jan,feb,mar,etc
    and my array vars are jan_click, feb_click and each of these is an array
    and I am trying to generate these at runtime

    [code=php]
    $mVal = substr($month,0 ,3);
    for($i=0;$i<cou nt($dbs);$i++)
    {
    #$str = "$".$mVal."_cli ck[".$i."]";
    $str = $mVal."_click[$i]";
    printf("<br> AAA :: %s :: %s ", $str, ${"$str"});
    }

    [/code]
    is not working can someone help me out with this plz
    Last edited by Atli; Oct 8 '07, 09:04 PM. Reason: Changed [code] tags to [code=php] tags.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    How is it not working?
    Are you getting any errors?
    (What is the '$dbs' variable?)

    Could you explain a little better what you are trying to do?

    Comment

    Working...