Hello @kartik,
Using password_hash is the recommended way to store passwords. Don't separate them to DB and files.
Let's say we have the following input:
$password = $_POST['password'];
You first hash the password by doing this:
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
Then see the output:
var_dump($hashed_password);
Hope it helps!!
Thank you!!