note 118451 added to function.filter-var
| From: | dan at spiral8 dot net | Date: | Tue, 08 Dec 2015 14:23:08 +0000 |
| Subject: | note 118451 added to function.filter-var | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204308@lists.php.net to get a copy of this message | ||
Here's a simple test using filter_var with FILTER_VALIDATE_URL.
(If you're using file_get_contents after this you will run into a problem, I was using: PHP
5.5.12 (cli))
<?php
$url = 'a://google.com';
$result = filter_var($url, FILTER_VALIDATE_URL);
if($result){
echo 'Valid URL'.PHP_EOL;
}
var_dump($result);
?>
The result is:
Valid URL
string(14) "a://google.com"
----
Server IP: 72.52.91.14
Probable Submitter: 79.113.74.97
----
Manual Page -- http://php.net/manual/en/function.filter-var.php
Edit -- https://master.php.net/note/edit/118451
Del: integrated -- https://master.php.net/note/delete/118451/integrated
Del: useless -- https://master.php.net/note/delete/118451/useless
Del: bad code -- https://master.php.net/note/delete/118451/bad+code
Del: spam -- https://master.php.net/note/delete/118451/spam
Del: non-english -- https://master.php.net/note/delete/118451/non-english
Del: in docs -- https://master.php.net/note/delete/118451/in+docs
Del: other reasons-- https://master.php.net/note/delete/118451
Reject -- https://master.php.net/note/reject/118451
Search -- https://master.php.net/manage/user-notes.php