As far as I know that can be used with PHP as well as HTML or anything, but what you use to make it is actually JavaScript, although some people do it with Flash.
I don't think you can do it strictly in PHP but JavaScript has those functions triggered by events that can be used with other languages (if user clicks link, do this, if user hovers mouse, do that, etc.).
I don't know much about JS myself but I know you can easily find tutorials for what you are looking for. Just Google "javascript menu tutorial" for example and you should get plenty.