PHP Code Editor
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Halaman Awal</title> <!-- Tailwind CSS CDN --> <script src="https://cdn.tailwindcss.com/3.0.1"></script> <!-- Your own CSS styles here if needed --> </head> <body class="bg-gray-100 text-center p-8"> <h1 class="text-3xl font-bold mb-2">Welcome to My Website!</h1> <p>Your PHP script is now connected to the Tailwind CSS CDN. You can apply Tailwind components and utilities directly in your HTML with this setup.</p> <pre> <?php // Define your target URL and the delay (in seconds) for each ping request. $targetURL = "http://www.google.com"; $pingDelayInSecs = 1; // Set your preferred delay time in seconds. // Create a new instance of cURL to send the HTTP GET request $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $targetURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); for ($i = 0; $i < 3; $i++) { // Send ping and sleep for the specified delay echo "Ping Sent: " . ($i + 1) . " of 3\n"; usleep($pingDelayInSecs * 1000); // Sleep for the delay time in milliseconds. } // Close cURL session curl_close($ch); ?></pre> </body> </html>
Run Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Halaman Awal</title> <!-- Tailwind CSS CDN --> <script src="https://cdn.tailwindcss.com/3.0.1"></script> <!-- Your own CSS styles here if needed --> </head> <body class="bg-gray-100 text-center p-8"> <h1 class="text-3xl font-bold mb-2">Welcome to My Website!</h1> <p>Your PHP script is now connected to the Tailwind CSS CDN. You can apply Tailwind components and utilities directly in your HTML with this setup.</p> <pre> <?php // Define your target URL and the delay (in seconds) for each ping request. $targetURL = "http://www.google.com"; $pingDelayInSecs = 1; // Set your preferred delay time in seconds. // Create a new instance of cURL to send the HTTP GET request $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $targetURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); for ($i = 0; $i < 3; $i++) { // Send ping and sleep for the specified delay echo "Ping Sent: " . ($i + 1) . " of 3\n"; usleep($pingDelayInSecs * 1000); // Sleep for the delay time in milliseconds. } // Close cURL session curl_close($ch); ?></pre> </body> </html>
Run Code New Tab
Result