How can I conditionally display something in Views header area depending on the argument in URL? The URL of my page view looks like my-view/%1/%2
The first argument %1 is term id of either vocabulary A or B or C and all of them are hierarchical taxonomy.

How can I conditionally display something in Views header global text area depending on which vocabulary %1 is or if it's parent term or child term?
I don't know if it's standard practice to answer such an old post, but another solution may be helpful to those who don't want to do any coding.  You can conditionally attach a header by using Views Attachments. This may not be the best practice for a production site, but that's another discussion. This answer is just to let you know of the possibilities.
Add an Attachment display for each Vocabulary you want a separate header for, and set their properties according to the images below. Notice that all attachment properties are overridden, in order to not affect your main Page or Master (default) display.
Edit: The images displayed below are for Views 3.x. Hopefully, they are helpful for Views 2.x, as well.

Add Attachment:


Add an attachment for each header you want displayed conditionally (as shown above).

Attachment Filter:



The above filter will ensure no records are displayed by the attachment, only the header.

Contextual Filter (1/2):



Set the contextual filter for each attachment (as shown above and below).

Contextual Filter (2/2):



Set the term to be used for this attachment (my example is &quot;Glossary&quot;). Be sure Action to take if filter value does not validate is set to 'hide', so that only the desired header is displayed.

Attach To Page:



Be sure to attach your attachment to something (here, attached to the &quot;Page&quot; display). Click on Global: Text Area to set your header.

Set Global: Text Area (in Attachment Header):



Click Global: Text Area (prev image) and set your desired header. Notice: still overridden. Also be sure to check Display even if view has no result since the filter for the attachment excludes all records.

Page/default Contextual Filter:



Last, but not least, set the Contextual Filter for the main page itself (not an attachment) according to your needs.