Kristina Anderson wrote:
Hmm...seems quick and easy.
I'm not sure how to do that in PHP though, any links to sample code?

I could use the transaction ID for that, which is what I really want to use somehow, as they are guaranteed unique.

MD5. Here's a function I use in a file_store class to generate a munged directory file path given (for instance) a user's unique ID.

    public function generate_upload_path($id)
    {
        $hash  = md5($id);
        $p1 = substr($hash, 0, 3);
        $p2 = substr($hash, 3, 3);

        return $this->attachments_dir . "/$p1/$p2/$id";
    }
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to