Use ->textContent instead of ->value in php

This allows us to handle both elements and attributes.