How to toggle HTML entities

I found this interesting problem yesterday. I don’t see any practical use case, but still it is a nice one and it could be used in a test about problem solving skills. The following function is based on Karolis’ solution, which was the cleanest.

{[ .toggle-function | 1.hilite(=php=) ]}

The interesting thing is that it’s a real toggle, meaning that

{[ .toggle-concept | 1.hilite(=php=) ]}