我无法理解"key => value"这段代码在php中?

use*_*726 2 php

我在下面的代码中得到了一个关于"$ key => $ value"的问题...我在google中查找了它但没有返回任何结果..我所知道的是"=>"用于数组比如x = array('a'=>'b').

function _stripslashes_rcurs($variable,$top = true)
    {
        $clean_data = array();
        foreach($variable as $key => $value)
        {
            $key = ($top) ? $key : stripslashes($key);
            $clean_data[$key] = (is_aray($value)) ?
                stripslashes_rcurs($value, false) : stripslashes($value);
        }
        return $clean_data;
    }
Run Code Online (Sandbox Code Playgroud)

谢谢您的帮助

Sas*_*gov 14

基本上它循环$variable并将键设置为$key和值$value.所以,让我们说这是你的arrray:

$variable = array(
  'a' => 'A'
  'b' => 'B'
  'c' => 'C'
);
Run Code Online (Sandbox Code Playgroud)

然后在循环的每次迭代中,$key将是小写字母之一,并且$value将是相应的大写字母.