2iia - Formations
2iia Menu Avion
2iia / FORMATION EN LIGNE
2iia Menu Avion
2iia / FORMATION EN LIGNE

Convertisseur de Température

Conversions rapides entre Celsius et Fahrenheit

Types de conversion :

Saisissez la température :

Code à copier :

<?php
// Pas de logique PHP supplémentaire nécessaire pour cette page
?>
<!DOCTYPE html>
<html lang="fr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Convertissez les températures entre Celsius et Fahrenheit avec notre outil PHP chez 2iia.">
    <meta name="keywords" content="convertisseur température, php, celsius, fahrenheit, 2iia, programmation">
    <meta name="robots" content="index, follow">
    <meta name="organization" content="2iia">
    <meta name="address" content="11 rue Daguerre, Paris, 75014, Île-de-France, France">
    <meta name="region" content="Île-de-France">
    <meta name="google-site-verification" content="DV6tpAHrvGRSKhf5o3r61pYAJRxRl4hVbe9nKgSGaJE">
    <title>Convertisseur de Température | 2iia</title>
    <link rel="canonical" href="https://www.2iia.com/convertisseur-temperature.php">
    <link rel="icon" href="img/favicon.ico" type="image/ico">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="manifest" href="/site.webmanifest">
    <meta property="og:title" content="Convertisseur de Température | 2iia">
    <meta property="og:description" content="Convertissez les températures entre Celsius et Fahrenheit avec notre outil PHP chez 2iia.">
    <meta property="og:image" content="https://www.2iia.com/img/2iia.jpg">
    <meta property="og:url" content="https://www.2iia.com/convertisseur-temperature.php">
    <meta property="og:type" content="website">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="Convertisseur de Température | 2iia">
    <meta name="twitter:description" content="Utilisez notre convertisseur de température PHP pour des conversions rapides et précises chez 2iia.">
    <meta name="twitter:image" content="https://www.2iia.com/img/2iia.jpg">
    <script>
        (function(w, d, s, l, i) {
            w[l] = w[l] || [];
            w[l].push({
                'gtm.start': new Date().getTime(),
                event: 'gtm.js'
            });
            var f = d.getElementsByTagName(s)[0],
                j = d.createElement(s),
                dl = l != 'dataLayer' ? '&l=' + l : '';
            j.async = true;
            j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-55SP3RLD');
    </script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/icofont.css">
    <link rel="stylesheet" href="style.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js"></script>
    <script src="script.js" defer></script>
    <script type="application/ld+json">
        {
            "@context": "http://schema.org",
            "@type": "Organization",
            "name": "2iia",
            "url": "https://www.2iia.com",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "11 rue Daguerre",
                "addressLocality": "Paris",
                "postalCode": "75014",
                "addressRegion": "Île-de-France",
                "addressCountry": "France"
            },
            "contactPoint": {
                "@type": "ContactPoint",
                "email": "rolanddehghank@yahoo.com",
                "telephone": "+33-7-80-89-36-89",
                "contactType": "service client"
            }
        }
    </script>
    <style>
        .vegetation-list a {
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            font-weight: 500;
            color: #00aaff;
            text-decoration: none;
            padding: 2px 4px;
            border-radius: 3px;
            transition: color 0.3s ease, background-color 0.3s ease;
        }

        .vegetation-list a:hover {
            color: #ffffff;
            background-color: #1a3c5a;
            text-decoration: none;
        }

        .vegetation-list .losange {
            display: inline-block;
            width: 8px;
            height: 8px;
            background-color: #00aaff;
            transform: rotate(45deg);
            margin-right: 10px;
        }

        a.elegant-button,
        button.elegant-button {
            display: inline-block;
            padding: 12px 24px;
            background-color: #00aaff;
            color: #ffffff;
            font-family: 'Inter', sans-serif;
            font-size: 1.1rem;
            font-weight: 600;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s ease, transform 0.2s ease;
            border: none;
            cursor: pointer;
        }

        a.elegant-button:hover,
        button.elegant-button:hover {
            background-color: #0088cc;
            transform: translateY(-2px);
            text-decoration: none;
        }

        .vegetation-list {
            list-style: none;
            padding-left: 0;
            margin: 1rem 0;
        }

        .vegetation-list li {
            margin-bottom: 0.75rem;
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            color: #ffffff;
        }

        .vegetation-container {
            padding: clamp(15px, 2vw, 20px);
            border-radius: 12px;
            width: 90%;
            max-width: 420px;
            margin: 6rem auto 2rem;
            transition: transform 0.2s ease;
        }

        .vegetation-container:hover {
            transform: translateY(-2px);
        }

        input[type="number"],
        select {
            width: 100%;
            padding: 0.8rem;
            margin-bottom: 1rem;
            border: none;
            border-radius: 5px;
            background-color: #1a3c5a;
            color: #ffffff;
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            transition: background-color 0.3s ease;
        }

        input[type="number"]:focus,
        select:focus {
            outline: none;
            background-color: #2d5a7a;
            box-shadow: 0 0 0 2px #00aaff;
        }

        label {
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            font-weight: 500;
            color: #ffffff;
            margin-bottom: 0.5rem;
            display: block;
        }

        p {
            margin: 1rem 0;
            font-family: 'Inter', sans-serif;
            font-size: 1.1rem;
            color: #ffffff;
        }

        pre {
            background-color: #1a3c5a;
            padding: 1rem;
            border-radius: 5px;
            border: 1px solid #2d5a7a;
            text-align: left;
            max-height: 200px;
            overflow-y: auto;
            margin: 1rem 0;
            scrollbar-color: #00aaff #1a3c5a;
        }

        code {
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            color: #e0e0e0 !important;
        }
    </style>
</head>

<body class="dark-theme">
    <noscript>
        <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-55SP3RLD" height="0" width="0" style="display:none;visibility:hidden"></iframe>
    </noscript>
    <?php include 'templates/header.php'; ?>
    <?php include 'templates/menu.php'; ?>
    <div class="vegetation-container">
        <div class="vegetation-content">
            <h1 class="vegetation-subtitle">Convertisseur de Température</h1>
            <h2 class="vegetation-subtitle">Conversions rapides entre Celsius et Fahrenheit</h2>
            <h2 class="vegetation-subtitle">Types de conversion :</h2>
            <ul class="vegetation-list">
                <span class="losange"></span> Celsius → Fahrenheit<br>
                <span class="losange"></span> Fahrenheit → Celsius
            </ul>
            <h2 class="vegetation-subtitle">Saisissez la température :</h2>
            <form method="POST" action="">
                <label>Entrez la température :</label>
                <input type="number" name="temperature" step="any" required>
                <label>Conversion :</label>
                <select name="type" required>
                    <option value="c_to_f">Celsius → Fahrenheit</option>
                    <option value="f_to_c">Fahrenheit → Celsius</option>
                </select>
                <button type="submit" class="elegant-button">Convertir</button>
            </form>
            <?php
            if ($_SERVER["REQUEST_METHOD"] == "POST") {
                $temperature = floatval($_POST["temperature"]);
                $type = $_POST["type"];
                $resultat = "";
                if ($type == "c_to_f") {
                    $resultat = ($temperature * 9 / 5) + 32;
                    echo "<h2 class='vegetation-subtitle'>Résultat :</h2>";
                    echo "<p>$temperature °C = $resultat °F</p>";
                } elseif ($type == "f_to_c") {
                    $resultat = ($temperature - 32) * 5 / 9;
                    echo "<h2 class='vegetation-subtitle'>Résultat :</h2>";
                    echo "<p>$temperature °F = $resultat °C</p>";
                } else {
                    echo "<h2 class='vegetation-subtitle'>Erreur :</h2>";
                    echo "<p>Type de conversion invalide.</p>";
                }
            }
            ?>
            <h2 class="vegetation-subtitle">Code à copier :</h2>
            <pre><code id="code-to-copy"><?php echo htmlspecialchars(file_get_contents(__FILE__)); ?></code></pre>
            <button onclick="copyCode()" class="elegant-button">Copier le code</button>
            <button onclick="window.location.href='https://2iia.com/contactez-nous.php'" class="elegant-button" aria-label="Nous contacter">Nous contacter</button>
        </div>
        <div class="cta-container">
            <div class="cta-block"></div>
        </div>
    </div>
    <div class="spacer-flash"></div>
    <?php include 'templates/footer.php'; ?>
    <script>
        function copyCode() {
            var code = document.getElementById("code-to-copy").innerText;
            navigator.clipboard.writeText(code);
            alert("Code copié !");
        }
    </script>
</body>

</html>
Footer