[Drupal] How to get the real path of a node, no matter it is a path or a url alias

Just test the code as below:

 

代码
$uri = substr(request_uri(), 1, strlen(request_uri()));
$uri_array = array();
if(!($path = drupal_lookup_path('source', $uri))) {
$uri_array = explode('/', $uri);
}
else {
$uri_array = explode('/', $path);
}

var_dump($uri_array);

 

Have fun!

posted @ 2010-08-23 14:16  DavidHHuan  阅读(390)  评论(0编辑  收藏  举报