CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Germany
    Posts
    451

    multi-hash in php

    I try to convert some code from C++/Qt to php.

    There is something like:
    Code:
    QMultiHash<int, QString> Var;
    It means that there can be many values associated to the same key, and at the same time, like:
    0 => "Zero"
    0 => "0"
    0 => "etc."

    How can it be done in php?

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: multi-hash in php

    One workaround could be to use an associative array of arrays, i.e.,
    PHP Code:
    $var = array(=> array("Zero""0""etc.")); 
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    May 2002
    Location
    Germany
    Posts
    451

    Re: multi-hash in php

    Good idea, thanks

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured