Results 1 to 2 of 2

Thread: Array and foreach

  1. #1
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Array and foreach

    Hi guys,

    Having a bit of trouble getting this to work. I should say before I start that im a rookie at PHP.

    Basically this is the code I have

    PHP Code:
    {counter start=print=false name=competcount}
    {foreach 
    item=compet from=$person.competition}
                    
    <
    img src="./bargraph/bar.php?value={$person.lineup[$compet.id].titular}&max={$club.matchsplayed[$compet.id].nummatchs}&info" /> 
    The problem lies with the $club array not being defined
    Code:
    $club.matchsplayed[$competition.id].nummatchs
    How do I set up multiple arrays with foreach? Am I even in the right ball park with this?

  2. #2
    Join Date
    May 2010
    Location
    Sacramento, CA
    Posts
    91
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Default

    suge,

    i'm stuck on something similar. i have two form entries on a page that input into an array, but i'm having trouble seperating the array into sections on the next page.

    I've been looking into

    array_slice & array_merge... i think this might help you.. good luck

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •