Closed (fixed)
Project:
Taxonomy Menu
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2008 at 22:54 UTC
Updated:
5 Oct 2008 at 15:32 UTC
Hi,
I have the following url's
www.wintersport-accommodaties.nl/taxonomy_menu/4/10 and
www.wintersport-accommodaties.nl/taxonomy_menu/4/10/15 (term 15 is a child of term 10)
How can I get the TID from these urls?
So 10 from the url www.wintersport-accommodaties.nl/taxonomy_menu/4/10
And 15 from the url www.wintersport-accommodaties.nl/taxonomy_menu/4/10/15
Something with strlen and strrpos , but I can not figure out how?
Thanks a lot in advance for your assistence!
greetings,
Martijn
Comments
Comment #1
derhasi commentedyou can use
$tid = array_pop(explode("/",$_GET['q']));Comment #2
summit commentedHi,
Thanks for your assistence!
But I got taxonomy_menu back from this php_code, and not the TID as asked.
Looking further http://drupal.org/node/180589#comment-277452 explains that $_GET['q'] gives the taxonomy_menu and not the TID (the rear end of both urls.\
Anyone else suggestions please?
Thanks a lot in advance.
greetings,
Martijn
Comment #3
Afief commented$_GET['q'] gives you the whole drupal path
explode divides it into pieces
array_pop gets the last piece
sounds just like what you need
Comment #4
summit commentedHi,
I succeeded in doing this! i twas not the url I needed to strip, but the $path. thanks for supporting!
greetings,
Martijn
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.