example.com:8080/browse?category=137 is my URL for a taxonomy category page.

How am I supposed to take the category ID (137) from that URI?

2 Answers 2


You can take that id from get array, try

print $_GET['category'];

If you are using Drupal 7 then you can make use of existing function drupal_get_query_parameters

But also you can use


Make sure you use check_plain() to be sure of save URL values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.