legacyblade Posted November 11, 2010 Share Posted November 11, 2010 Hello. I'm working on a site which I'd prefer to use SVG for some of the images. However, since not all browsers support SVG, I'm going to set a global variable to true if I detect the browser supports SVG. Using this, I can check to see if SVG is supported and show PNG/gif/jpg images in the place of the SVG in older browsers (and add a small banner at the top prompting them to upgrade to a modern browser). I can already do this using javascript. But seeing as javascript can be disabled, newer browsers that can support SVG might not be fed those images (which are much smaller files). The javascript I'm using to test SVG support is as follows document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.1") the php code I tried, seeing as how it would make sense, is the following DOMImplementation::hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.1") (both of those were used in conditional branches) Is there any way to get php to test for SVG support? Or do I need to stick with javascript? Thanks for reading! Quote Link to comment Share on other sites More sharing options...
Dragosvr92 Posted November 12, 2010 Share Posted November 12, 2010 hmm the only way i know in PHP Would be to get a list of all Browsers that Support .SVG Images And use the HTTP_USER_AGENT PHP Variable to check the browser i only discovered SVG Images a few months ago while i was on Wikipedia looking at flags Check this .. maybe it will help you with something http://www.codingforums.com/archive/index.php/t-112277.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.