If you want/have to sort your data with PHP, then you will have to send a request (Ajax: http://api.jquery.com/jQuery.get/) to your server and do the PHP magic. On response, you re-display your data via JS.
If the kind of sorting you need to perform is rather simple, then try to do it with JS; will be much(!) faster. Maybe this helps: https://datatables.net/