Use of => in PHP

后端 未结 5 1477
轮回少年
轮回少年 2020-12-17 18:24

What does this mean in PHP and when is the time to use it?

 =>

Another example.

 foreach ($parent as $task_id => $tod         


        
5条回答
  •  醉梦人生
    2020-12-17 18:59

    You can use it working with arrays:

    array ("key" => "value", "key" => "value")
    

    ... or in a foreach statement:

    foreach ($my_array as $key => $value)
    ...
    

提交回复
热议问题