php3-list | 199901
Date: 01/23/99
- Next message: Matthew Joseff: "[PHP3] Boggle"
- Previous message: Rasmus Lerdorf: "Re: [PHP3] file locking?"
- Next in thread: Rasmus Lerdorf: "Re: [PHP3] How to get all possible permutations from an array in PHP?"
- Reply: Rasmus Lerdorf: "Re: [PHP3] How to get all possible permutations from an array in PHP?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
I have a classic CompSci-problem tonight. I wrote this algorithm
in a class last year (in Scheme), but now I just can't figure it out.
I need a PHP-function that takes an array as input and returns all
possible permutations. I'm writing a searchengine for my personal
webpages and it would be great to be able to show partial matches
instead of just a "perfect 100%" hit.
If the array was [A,B,C] my result should be:
[A,B,C]
[A,B]
[A,C]
[B,C]
[A]
The order of the elements doesn't matter. I have searched
the "usual" PHP-algorithm-archives, but to no avail. Has
someone out there already written this and could show me
how?
Yours Sincerely,
Erik Tjernlund <erik <email protected>>
Royal Institute of Technology
Stockholm, Sweden
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>
- Next message: Matthew Joseff: "[PHP3] Boggle"
- Previous message: Rasmus Lerdorf: "Re: [PHP3] file locking?"
- Next in thread: Rasmus Lerdorf: "Re: [PHP3] How to get all possible permutations from an array in PHP?"
- Reply: Rasmus Lerdorf: "Re: [PHP3] How to get all possible permutations from an array in PHP?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

