This question already has an answer here:
Is there a default built in function in PHP that allows for use of scrypt or bcrypt?
</div>
This question already has an answer here:
Is there a default built in function in PHP that allows for use of scrypt or bcrypt?
</div>
For PHP 5.5.0 or above:
Read the relevant FAQ on PHP.net. More notably, you should check out this page on password hashing. Example:
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, array('cost' => 12));
For earlier versions, look at the password_compat library by ircmaxwell.