cos1.3 - PHP Online

Form of PHP Sandbox

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.



Your result can be seen below.

Result of php executing





Full code of cos1.3.php

  1. <?php
  2. $url = 'https://wtools.io';
  3. $pattern = '/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(?::\d{1,5})?(?:$|[?\/#])/i';
  4. if (preg_match($pattern, $url)) {
  5.     $output = "$url is a valid URL";
  6. } else {
  7.     $output = "$url is not a valid URL";
  8. }
  9. echo $output;
  10.  
File Description
  • cos1.3
  • PHP Code
  • 20 Mar-2024
  • 279 Bytes
You can Share it: