-2

I have this array

Array ( [0] => User Object ( [id] => [username] => [password] => $2y$10$JJkkoa89X0gNmaEtzeLsI.GkKXqWx8R18MoHwglZkXkDPo5PdlnZe [first_name] => [last_name] => ) ) 1

can i get password as string ?

Raj
  • 22,346
  • 14
  • 99
  • 142
designerdarpan
  • 197
  • 1
  • 3
  • 19

2 Answers2

0

The password is hashed, i.e., some algorithm has been used to encrypt the original string. There are two ways

  • Either you find the appropriate algo and decrypt it
  • Just comparisons are possible. The comparison of actual password string with this hashed value will return true, so no need to get the original password string.
Pbd
  • 1,219
  • 1
  • 15
  • 32
0

You can use the casting operators

 $password = (string) $arr[0]['password'];
Pramod Patil
  • 2,704
  • 2
  • 14
  • 20