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=1834 YWPd6nk1TKRPyaD2KYzhY3vhcm33KArMxGEK5EKawp74L6YgrBpLmXcb8bk1ZsyF 598a17e7ea1e6490ea3819e29dceeb9381b5980b&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1834 yWMjtu9FxUjapcTSnvf3GkyziJNN0Tj-ADNw5g3fGL7aoCPZMkd83Zm47YHbFUf0 7cd3391ba476a87bf582495ae36c3f0714bd10b7&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1833 Q-Vn_lOOhEuFJ9uqXKk8SrqN5AqsYEoTQgasbPXyzlq892UO9llKE_liyi4PGpDe e7c900021e88f31490a3f8898d48740cee42f2c3&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1832…