Yup. Except donāt create your own salt. The new password_hash function will do that for you. Also, Iād suggest not specifying the algorithm either. One day, something better than bcrypt might come along and become the new default. When that happens, if you didnt specify bcrypt, then you get the new algorithm for free.
This function was introduced in PHP version 5.5. If youāre on less than that, then check out the āuserland implementationā in the āsee alsoā section.