Menu

#3 Associative arrays with add()

open
nobody
None
5
2003-04-03
2003-04-03
Tyler Akins
No

Associative arrays don't work properly when used with
add() when the fields are in the wrong order. To
combat the problem, I wrote a little patch. This will
let you use associative arrays or normal arrays with add().

Discussion

  • Tyler Akins

    Tyler Akins - 2003-04-05

    The patch in question

     
  • Tyler Akins

    Tyler Akins - 2003-04-05

    Logged In: YES
    user_id=73968

    Dang -- forgot to check that checkbox when I uploaded the
    file last time.

     
  • Tyler Akins

    Tyler Akins - 2003-04-05

    Logged In: YES
    user_id=73968

    Strike two. There's a bug with the patch.

    Change this line
    if (isset($arr[$data[0]]))
    to this one
    if (isset($arr2[$data[0]]))

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.