xref: /PHP-5.4/ext/filter/tests/022.phpt (revision 2c3db736)
1--TEST--
2filter_var() and FILTER_SANITIZE_EMAIL
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7
8var_dump(filter_var("a@b.c", FILTER_SANITIZE_EMAIL));
9var_dump(filter_var("a[!@#$%^&*()@a@#$%^&*(.com@#$%^&*(", FILTER_SANITIZE_EMAIL));
10var_dump(filter_var("white space here \ \ \" som more", FILTER_SANITIZE_EMAIL));
11var_dump(filter_var("", FILTER_SANITIZE_EMAIL));
12var_dump(filter_var("123456789000000", FILTER_SANITIZE_EMAIL));
13
14echo "Done\n";
15?>
16--EXPECTF--
17string(5) "a@b.c"
18string(30) "a[!@#$%^&*@a@#$%^&*.com@#$%^&*"
19string(21) "whitespaceheresommore"
20string(0) ""
21string(15) "123456789000000"
22Done
23