کد PHP:
public static function forget(&$array, $keys)
{
$original = &$array;$keys = (array) $keys; if (
count($keys) === 0) {
retu;
} foreach (
$keys as $key) {
// if the exact key exists in the top-level, remove it
if (static::exists($array, $key)) {
unset($array[$key]); continue;
}
$parts = explode('.', $key);// clean up before each pass
$array = &$original; while (
count($parts) > 1) {
$part = array_shift($parts); if (isset(
$array[$part]) && is_array($array[$part])) {
// بیشتر از همه خط زیر رو نمیفهمم!
$array = &$array[$part];
} else {
continue 2;
}
} unset(
$array[array_shift($parts)]);
}
}
ما را در سایت php مرکز کد های سایت دنبال میکنید
برچسب: نویسنده: استخدام کار بازدید: 229