我有几个PHP文件充满了多个功能。让我们称他们functions1.php,functions2.php,functions3.php:生成一组函数?
function function_something($atts) {
extract(something_atts(array(
'foo' => 'bar',
'bar' => 'foo,
), $atts));
return 'something';
}
我加载这些文件中all_functions.php这样的:
require_once('functions1.php');
require_once('functions2.php');
require_once('functions3.php');
我不知道是否有可能创建一个包含所有这些函数及其属性的数组?
我想是这样的:
function my_functions() {
require_once('functions1.php');
require_once('functions2.php');
require_once('functions3.php');
}
然后一些foreach循环,但我不知道应该怎么看起来像毕竟。
我知道这可能看起来非常棘手,但我只是好奇,如果我能列出我所有的WordPress的简而不PHP的反射API :)
真的坏主意...... – Baba 2012-03-22 17:34:16