Access WordPress user info outside WordPress

Solution:

Using the wordpress API would be the best way and as each case is a case it’s not possible to get code ready for exactly what you say, but follow the documentation link about the api part that can help you:

https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/

here you have another example of how to create endpoints for custom logins: Register/login user with WordPress JSON API

And this other one here of how to create a php request curl on another site that in your case would be the wordpress API: https://phpenthusiast.com/blog/five-php-curl-examples