I am looking for a way to count dynamic li elements inside ul in php (not js).
For instance:
<ul> <li> lorem </li> <li> ipsum </li> <li> dolor </li> <li> sit </li> </ul>
will return me the number 4 . (am I too stupid to use the correct code here?)
Is there any way to do this in php?
Thanks in advance!
EDIT:
The markup is created by the cms system, the account must be placed in front of the list inside the template file.
source share