【发布时间】:2015-04-25 12:06:00
【问题描述】:
我创建了一个包含包含文件的函数, 我可以将此功能与其他功能进行比较吗?
例如
在一个.php中
<?php
$a = "this is file";
?>
在 b.php 中
<?php
$b = "this is file";
?>
在function.php中
<?php
function a(){
include("a.php");
}
function b(){
include ("b.php");
}
/*
my question is can I compare between function a() and function b() ?
like this
*/
if(a()==b()){
echo "it's same words";
}
else
{echo "not same words";}
?>
我知道有一种简单的方法来处理我的情况,但这只是一个示例, 我想用这种方式来做我复杂的算法。
问候。
努尔哈里亚迪
【问题讨论】:
-
你的函数需要返回一些东西。然后您可以比较它们返回的内容。