时间:2021-07-01 10:21:17 帮助过:5人阅读
1 php
2
3 function filled_out( $form_vars )
4 {
5 // test that each variable has a value
6 foreach ( $form_vars as $key => $value )
7 {
8 if ( ! isset ( $key ) || ( $value == '' ))
9 return false ;
10 }
11 return true ;
12 }
13
14 function valid_email( $address )
15 {
16 // check an email address is possibly valid
17 if ( ereg ( ' ^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$ ' , $address ))
18 return true ;
19 else
20 return false ;
21 }
22
23 ?>
24