In PHP exists the native function md5() for calculating MD5 hashes. It is called with the message to be hashed, and as a result you get the hexadecimal hash value:
md5("Message to be hashed");
In this example, the result is the hash "416b158b5c706ca67301c2dbecaaf235".