Home > php教程 > php手册 > body text

ZF框架校验器InArray的使用

WBOY
Release: 2016-06-06 19:33:11
Original
1240 people have browsed it

作业练习 Zend Framework ?phprequire_once("Zend/Loader.php");Zend_Loader::loadClass("Zend_Validate");Zend_Loader::loadClass("Zend_Validate_InArray");function check_inarray($person){$array = array('张三','李四','王五','赵六','田七');$Validate

作业练习 Zend Framework
<?php
require_once("Zend/Loader.php");
Zend_Loader::loadClass("Zend_Validate");
Zend_Loader::loadClass("Zend_Validate_InArray");

function check_inarray($person)
{
	$array = array('张三','李四','王五','赵六','田七');
	$Validate = new Zend_Validate_InArray($array);
	if ($Validate -> isValid($person))
	{
		echo "有这个人!";
	}
	else
	{
		echo "没这个人!";
	}
}
$person = '张三';
check_inarray($person);
?>
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!