Is there a way to do either of the following:
1) Create a function with an internal counter that tracks how many times the function has been called on the page, without re-loading the page or in any way sending the count data to the function as a variable.
2) Create link code that counts how many times the link has been clicked and either: a) sends that count data to the link destination, or b) uses the count data to modify the link destination (i.e. add a running $count var to the end of the link destination code); the link destination may be a php function or an in-page bookmark, but again, all must be done without re-loading the page.
I found Countable::count() in the manual, but am unclear whether it works here.