123 - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of 123.php
- <?php
- // Подключаем библиотеку для генерации QR-кода (например, PHP QR Code)
- require_once('phpqrcode/qrlib.php');
- // Проверяем, является ли устройство мобильным
- if (preg_match('/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i', $_SERVER['HTTP_USER_AGENT'])) {
- // Определяем операционную систему устройства
- if (preg_match('/iPhone|iPad|iPod/i', $_SERVER['HTTP_USER_AGENT'])) {
- // Если iOS
- $appStoreUrl = 'https://apps.apple.com/ru/app/vending-wallet/id1267203510';
- generateQRCode($appStoreUrl);
- exit;
- } else if (preg_match('/Android/i', $_SERVER['HTTP_USER_AGENT'])) {
- // Если Android
- $googlePlayUrl = 'https://play.google.com/store/apps/details?id=hr.intis.wallet&hl=uk&gl=US';
- generateQRCode($googlePlayUrl);
- exit;
- } else {
- // Если другая мобильная ОС, например, вход с ПК
- // Здесь можно перенаправить на другой маркет или страницу с инструкцией по установке приложения
- die("К сожалению, ваша операционная система не поддерживается");
- }
- }
- // Функция для генерации QR-кода
- function generateQRCode($url) {
- // Установите путь для сохранения QR-кода на сервере
- $path = 'qrcodes/';
- $filename = 'qr_code.png';
- $filePath = $path . $filename;
- // Генерируем QR-код с использованием URL-адреса
- QRcode::png($url, $filePath, 'H', 10, 2);
- // Выводим QR-код
- echo '<img src="' . $filePath . '" alt="QR Code">';
- }
- ?>
File Description
- 123
- PHP Code
- 23 May-2023
- 1.79 Kb
You can Share it:
Latest PHP Pastes