wp_is_mobile() (ok)

https://developer.wordpress.org/reference/functions/wp_is_mobile/