How to check from which page the user is coming to the current page?

Is there a way of doing this with WordPress aside from using $_SERVER['HTTP_REFERER']?

Maybe something like a blend of $_SERVER['HTTP_REFERER'] and is_category(). Something like,

came_from_category( 'uncategorized' )

or

came_from_home()

Topic functions php references Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.