I have two pages, page A and page B. Page A will hold an unknown number of unordered list elements. I wont have any control on how many list elements there are.
On Page B, I’d like to use PHP to grab the number of li from Page A and display that number. The idea is Page A will hold WordPress post links that a user has favorited, while Page B will display that amount of favorites.
Any help would be wonderful. Thanks
Parse html from another page using PHP Simple HTML DOM Parser. Download it and include to your script:
Okay. Looks like OP don’t need to use serverside code. Use javascript for this (don’t forget to include jQuery):
This will replace content of element
#favorites
with number ofli
s in /favorites file