I would echo out the number from PHP into a span with an id attribute (if there is only one occurrence of it on the page) or in a class attribute. Then I would reference that or those spans on page load in jQuery to animate them. For example:
I did it with this plugin https://github.com/bfintal/Counter-Up, it's really easy, but i had to put script code into main view, i didn't include any JS code for now. Numbers are now animated!