常用函数-get_usermeta()

0条评论

常用函数-get_usermeta()

说明

用户编号被userid参数传递后,get_usermeta()函数返回该用户中指定metakey的值。

用法

<?php get_usermeta(userid,'metakey'); ?>

示例

本示例返回并显示编号为9用户的姓氏。

<?php $user_last = get_usermeta(9,'last_name'); ?>  
<?php echo('User ID 9's last name: ' . $user_last . '\n'); ?>  

 

编号为9用户的姓为:Jones

参数

$user_id

(整数)(必需)用户编号,该用户的资料将被检索。

默认值:None

$meta_key

(字符串)(必需)将要返回的metakey的值

默认值:None

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.