xref: /PHP-8.1/ext/filter/tests/022.phpt (revision 74859783)
1--TEST--
2filter_var() and FILTER_SANITIZE_EMAIL
3--EXTENSIONS--
4filter
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 \ \ \" some 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--EXPECT--
17string(5) "a@b.c"
18string(30) "a[!@#$%^&*@a@#$%^&*.com@#$%^&*"
19string(22) "whitespaceheresomemore"
20string(0) ""
21string(15) "123456789000000"
22Done
23