views:

41

answers:

4

How to set php web compatibility with different browser?

+2  A: 

Do nothing.

PHP has no incompatibilities with browsers.

The client side code you send to those browsers might have incompatibilities, but those should almost always be resolved at the client side level (e.g. by using better support APIs or using conditional comments)

David Dorward
+4  A: 

PHP is not supposed to provide you any cross browser capability. It does not depend on the browser. It is a server side technology. The HTML is rendered and styled by the developer/designer. So providing browser compatibility is the responsibility of the developer/designer.

Kangkan
A: 

What do you mean by web compatibility? PHP runs on all supported operating systerms and machines. PHP does not have browser compatibility issues too and it can't, it just sends output to the browsers.

Sarfraz
A: 

If you want to decide which html/css/js code to server to the client you can take a look at the browser's user agent stored in $_SERVER['HTTP_USER_AGENT'].

moreover, get_browser() can tell you about the browser's specific capabilities.

chros