is it possible to check (with PHP) if the browser supports SVG?
like ...
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 about to check the browser and the version? 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 anybody know a nice SVG-Browser-Support-List?
You could probably do the check using JavaScript and Raphael, and then send that back to the server.