$user_id = 123; // user ID $field_name = 'name'; // field name $user_name = User::getField($user_id, $field_name); echo "The user's name is $user_name";
$user_id = 123; // user ID $field_name = 'email'; // field name $user_email = User::getField($user_id, $field_name); echo "The user's email address is $user_email";
$user_id = 123; // user ID $field_name = 'phone'; // field name $user_phone = User::getField($user_id, $field_name); echo "The user's phone number is $user_phone";In this example, the `User getField` function retrieves the user's phone number by passing the user ID and the field name 'phone' as arguments. The retrieved phone number is then stored in the `$user_phone` variable and displayed on the screen. Package Library: This function can be found in the Magento package library.