デバイスを検出するページを作成しています。私はDetect Deviceを検出に使用しています。しかし、私はエラーを取得しています:PHPでデバイスを検出中に未定義のプロパティエラーが発生しました
マイのindex.php
そのエラーを解決する方法<?php include 'detect.php';
if (Detect::isMobile()) {
}
// Gets the device type ('Computer', 'Phone' or 'Tablet').
echo Detect::deviceType();
// Any phone device
if (Detect::isPhone()) {
}
// Any tablet device.
if (Detect::isTablet()) {
}
// Any computer device (desktops or laptops).
if (Detect::isComputer()) {
}
// Get the IP address of the device.
echo Detect::ip();
// Get the ID address host name of the device.
echo Detect::ipHostname();
// Get the IP address organisation of the device.
echo Detect::ipOrg();
// Get the country the IP address is in (IP address location inaccurate).
// (JS function available which uses GPS)
echo Detect::ipCountry();
// Get the name & version of operating system.
echo Detect::os();
// Get the name & version of browser.
echo Detect::browser();
// Get the brand of device (only works with mobile devices otherwise return null).
echo Detect::brand();
// Check for a specific platform with the help of the magic methods:
if (Detect::isiOS()) {
}
if (Detect::isAndroidOS()) {
}
?>
<head>
...
<script type="text/javascript" src="path_to/detect.js"></script>
...
</head>
<script>
// Get screen width in pixels.
detect.screenWidth();
// Get screen height in pixels.
detect.screenHeight();
// Get viewport (browser window minus any toolbars etc) width in pixels.
detect.viewportWidth();
// Get viewport (browser window minus any toolbars etc) height in pixels.
detect.viewportHeight();
// Get latitude from GPS & update html conent of ID element passed.
// Null, if GPS unavailable.
detect.latitude("latitude");
// Get longitude from GPS & update html conent of ID element passed.
// Null, if GPS unavailable.
detect.longitude("longitude");
// Get address from GPS & update html conent of ID element passed.
// Null, if GPS unavailable.
detect.address("address");
</script>
?
デバイスを検出する機能を提供する他のWebサイトはありますか?
私はデバイスを検出するページを作成しています。私はDetect Deviceを検出に使用しています。しかし、私はエラーが発生しています:See Here。
これはエラーではありません。しかしただの通知!残りのコードは完全に動作し、この警告を抑制するためにdetect.phpファイルをチェックします。通知に見られる行番号248。 – Shan