PHP code example of basteyy / url-scheme-validator
1. Go to this page and download the library: Download basteyy/url-scheme-validator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
basteyy / url-scheme-validator example snippets
$validator = new \basteyy\UrlSchemeValidator\UrlSchemeValidator('http://www.example.com');
echo $validator->getScheme(); // Returns http
$validator = new \basteyy\UrlSchemeValidator\UrlSchemeValidator('//www.example.com');
// Change the Default Scheme
$validator->setDefaultScheme('file');
echo $validator->getUrl(); // Returns file://www.example.com
// Validate direct for web (only http and https)
var_dump($validator->isWebScheme()); // Returns false in this case (case now its file)
var_dump($validator->isWebScheme('https://example.com')); // Returns true
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.