• 实例首页
  • 自学教程
  • IT工具箱
xxxxxxxxxx
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>PHP array_map() 实例 - 自学教程(runoops.com)</title>
6
</head>
7
<body>
8
​
9
<?php
10
function myfunction($v)
11
{
12
    $v=strtoupper($v);
13
    return $v;
14
}
15
 
16
$a=array("Animal" => "horse", "Type" => "mammal");
17
​
18
echo '<pre>';
19
print_r(array_map("myfunction",$a));
20
echo '</pre>';
21
?>
22
​
23
</body>
24
​
25
</html>