开发者

Drupal6 - Getting term id from term name

Hi

Suppose I开发者_StackOverflow have a term name called "product" and the term id is "123", how can I use the term name "product" to get the term id "123"?

Thanks


$get_term = taxonomy_get_term_by_name('product');

$term_id = $get_term[0]->tid;

This should work for you.


use this function

taxonomy_get_tid_by_name('product')

return value is array .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜