#******************************************************************************
# This is a super-hard array conversion function.(PHP.net)
#******************************************************************************
#It only returns TRUE if the two arrays are completely identical, that means that
#they have the same keys, and the values of all keys are exactly the same (compared with ===)
function array_same($a1, $a2) {
if (!is_array($a1) || !is_array($a2))
return false;
$keys = array_merge(array_keys($a1), array_keys($a2));
foreach ($keys as $k) {
if (!isset($a2[$k]) || !isset($a1[$k]))
return false;
if (is_array($a1[$k]) || is_array($a2[$k])) {
if (!array_same($a1[$k], $a2[$k]))
return false;
}
else {
if (! ($a1[$k] === $a2[$k]))
return false;
}
}
return true;
}
#******************************************************************************
[Monday, January 07, 2008
|
0
comments
]
Popular Posts
- php questions
- some php questions
- How to create a plugin in elgg.
- php Questions
- Mysql query for searching a value, add weightage on the number of occurances and sort based on the weight-age
- Contact Me
- solving the packaging problem in PHP
- How to add or remove WWW on URLs using htaccess.
- php questions
- Inserting nodes into xml files using XML DOM in PHP .
0 comments
Post a Comment
Please put your comments here. your questions, your suggestions, also what went wrong with me.