Never store passwords in clear text - it is a major security risk. There is some information on how to do it here:
Password Storage: How to do it.[
^] - the code is in C#, but the text explains why you do this. For PHP, there are built in methods for hashing passwords:
https://www.sitepoint.com/hashing-passwords-php-5-5-password-hashing-api/[
^]
And remember: if this is web based and you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and store them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that.