I have 2 files abc.php and xyz.php. When i open in mobile, it includes abc.php and on desktop xyz.php is included. I have included these files below but it's not working. Any suggestions welcome.
<script>
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
<?php include ('abc.php');?>
} else {
<?php include ('xyz.php');?>
}
</script>
useragentis not reliable anyway but you could use php to process the useragent rather than javascript