Replace WP Next & Previous post with better Pagination

Replace your typical next and previous pagination ie:

with the example as follows to create better pagination.
PHP