MD5 "encryption" the same in AS3 and PHP

I am currently in need of being able to encrypt a string to MD5 (yes, I know you don’t technically encrypt it, since you can’t really decrypt it, but I’m not sure what to call it, and you get the point!)

A few weeks back I needed some MD5 for a PHP and MySQL site, and several people warned of the fact that the PHP function for encrypting and the MySQL function for encrypting don’t always return the same results.

**It is very important for me to find an AS3 function as well as a PHP function that returns the exact same MD5 string when the same parameters are passed into both functions.

**Anything available out there?(It’s a bit time sensitive)