How to detect Safari browser

PHP, JS: How to detect Safari browser

PHP Example: Result: Javascript Recent search terms:https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1887 OvgUxpr9qO2nSY7xfBBfqrMyKKrUz4ZjLCjLo80gRf5IrfuQNKFPcR5BNsfVUgiM 7aaec94f496207709c48efc5ef2ebb32c8e11a85&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1835 ZGxufH30J8MJ_MDW7_eEPqzMtLH9KZq8nNB_Q8AcDKcWl3j5lklju-sDkwa1khhA c51e1f08e2bd267b995c9b636faf220c76be524c&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1835 VU0AO2XBnXAZrUdIOOnGU2LZptOW-7sGYnKlwIMZoY93wSAEclh_oMkdv0xeid7I 0f7712dd02c0521c3ad075f1e38c65ae67edd337&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1834 YWPd6nk1TKRPyaD2KYzhY3vhcm33KArMxGEK5EKawp74L6YgrBpLmXcb8bk1ZsyF 598a17e7ea1e6490ea3819e29dceeb9381b5980b&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1834…