守则是这样的:
<?php
$res = $this->find('all', $cond); // All the data are fetched from this $res
$count = count($res);
for ($i = 0; $i < $count; $i++) {
$result[] = $res[$i];
$data = array(); //temporary array
$data[$i]['MyData'] = $result[$i]['MyData'];
$data[$i]['MyData']['my_test'] = $result[$i]['c']['my_test'];
$data[$i]['MyData']['my_date'] = $result[$i]['a']['my_date'];
}
$result['data'] = $data;
这在Perl中意味着什么?
答案 0 :(得分:2)
它等同于if ($a =~ /Y/i)
,这是一个正则表达式,用于测试变量$a
是否包含字母Y
。最后的i
会使测试不区分大小写,因此大写或小写Y
将匹配。