2

I need to check if an international URL is valid. For example:

http://täst.de/äxample-url/

How can I do that? I can use any Composer package.

AbraCadaver
  • 78,200
  • 7
  • 66
  • 87
user1878980
  • 515
  • 2
  • 8
  • 21
  • You could use Zend\Validator\Hostname (http://framework.zend.com/manual/current/en/modules/zend.validator.hostname.html) – d0ug7a5 Jun 29 '15 at 15:07

1 Answers1

-2

You can try to test the url using a filter from PHP.

Example:

    $url = "http://www.w3schools.com";

    if (!filter_var($url, FILTER_VALIDATE_URL) === false) {
        echo("$url is a valid URL");
    } else {
        echo("$url is not a valid URL");
    }

http://www.w3schools.com/php/filter_validate_url.asp http://php.net/manual/en/filter.filters.validate.php

Miguel
  • 126
  • 9