PHP to get user data based on email address
-
Hi guys.
I am looking for some code that would get the user data from a different user.
The current user is logged in and has some extended profile information, including a secondary email address (non-unique). This secondary email address will be the same email address as a related user (a friend or partner)
I can easily call up the secondary email address and echo onto the page, but I would like to know how to within a PHP snippet to use the secondary email address to then get other data from the user of that email address.
This code gets the secondary email of the current user. I want to take the result and use it to get data from the user it belongs to.
<?php $user_info = get_userdata(1); echo 'Username: ' .$user_info->user_login . "\n"; echo "</br>"; echo 'User ID: ' . $user_info->ID . "\n"; echo "</br>"; echo 'Partners Email Address: ' . $user_info->secondary_user_email . "\n"; ?>
The topic ‘PHP to get user data based on email address’ is closed to new replies.