/* * 測試参数完整,并格式化数组参数 * 返回 FALSE, array public function format_array_value($a_params = null, $a_rule = null) { if( is_array($a_params) && !empty($a_params) && is_array($a_rule) && !empty($a_rule) ) { foreach ($a_rule as $key => $value) { if(array_key_exists($key, $a_params)) { if($value == 'int' or $value == 'integer') $a_params[$key] = intval($a_params[$key]); elseif ($value == 'string') { $a_params[$key] = strval($a_params[$key]); }elseif ($value == 'double' or $value == 'float') { $a_params[$key] = doubleval($a_params[$key]); }elseif ($value == "boolean") { $a_params[$key] = $a_params[$key] ? true : false; }elseif (preg_match("/^[%bcdeufFosxX]$/",$value)){ // 生成字符字 $a_params[$key] = sprintf("%".$value,$a_params[$key]); }else{ return FALSE; } }else{ return FALSE; } } return $a_params; } else { return FALSE; } } //end check_array_value func
以上就是一段没什么意思的代码的内容,更多相关内容请关注PHP中文网(www.php.cn)!
Statement
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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Assassin's Creed Shadows: Seashell Riddle Solution
2 weeks agoByDDD
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download
The most popular open source editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)