PHP SVG Check with Dropback Possibly?

Is it possible to check (from PHP) if the browser supports SVG?

as...

if( BROWSER support SVG )
{
   $iT = 'svg';              // Icon type
}
else
{
   $iT = 'png';              // Icon type
}    

      

in HTML code ...

<img src="icons/home.<?=$iT?>" class="icon" />

      



EDIT:
How do I check the browser and version? A good idea?

$data['browser'] = strtolower($data['browser']);

if     ($data['browser'] == 'firefox' && (int)$data['browser']['version'] >= 10)
       $iT = 'svg';

elseif ($data['browser'] == 'safari'  && (int)$data['browser']['version'] >= 5)
       $iT = 'svg';

 .... and so on

      

PS: Did anyone know a good SVG-Browser-Support-List?

+3


source to share


1 answer


Maybe you can do validation with JavaScript and Raphael and then send it back to the server.



+3


source







All Articles