forked from OOPS-ORG-PHP/ereg-extension-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
34 lines (26 loc) · 800 Bytes
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once 'ereg-wrapper.php';
$subj = "This sentence contains the telnet URL telnet://10.19.21.4";
$pat = "telnet://([a-z0-9.]+)";
echo "EREG test :\n\n";
if ( ereg ($pat, $subj, $regs) ) {
print_r ($regs);
}
echo "\nEREGI test :\n\n";
$pat = "TELNET://([a-z0-9.]+)";
if ( eregi ($pat, $subj, $regs) ) {
print_r ($regs);
}
echo "\nEREG REPLACE test : ";
$pat = "telnet://([a-z0-9.]+)";
echo ereg_replace ($pat, "https://\\1", $subj) . "\n";
echo "\nEREGI REPLACE test : ";
$pat = "TELNET://([a-z0-9.]+)";
echo eregi_replace ($pat, "https://\\1", $subj) . "\n";
echo "\nSPLIT test : ";
$date = "04/30/1973";
list($month, $day, $year) = split('[/.-]', $date);
echo "Month: $month; Day: $day; Year: $year\n";
echo "\nSQL RECASE test : ";
echo sql_regcase("Foo - bar.") . "\n";
?>