Good question.
I want to use php for two reasons.
1. I will probably use javascript as the first option, but php will be the backup in case the user has javascript disabled.
2. No one (I think, please tell me if you know otherwise) has ever implemented this in php, so if I do, hopefully someone else will have a use for it.