删除php关联数组中array2中存在的dos1的array1值

时间:2015-09-03 06:41:49

标签: php arrays

我在PHP中有五个关联数组,其中包含数据库中的数据。

以下是数组1的示例:

Array1
   (
[0] => Array
    (
        [id] => 2
        [status] => 0
        [user] => 86
        [project] => 0
        [project1] => 0
        [project2] => 0
        [project3] => 0
        [project4] => 0
        [project5] => 0
        [project6] => 0
        [email] => info@mail.com
        [day] => 06/30/2013

    )
     [1] => Array
    (
        [id] => 2
        [status] => 0
        [user] => 86
        [project] => 0
        [project1] => 0
        [project2] => 0
        [project3] => 0
        [project4] => 0
        [project5] => 0
        [project6] => 0
        [email] => infox@mail.com
        [day] => 06/30/2013

    )
)

现在这里是数组2

   Array
     (
      [0] => Array
        (
            [id] => 2
            [status] => 0
            [user] => 86
            [project] => 0
            [task] => 36
            [email] => info@mail.com
            [day] => 06/30/2013

        )
           )

我想在array2的第一个数组上应用过滤器,仅在结果数组中应用过滤器后显示此内容

  result
      (
     [0] => Array
           (
     [id] => 2
    [status] => 0
    [user] => 86
    [project] => 0
    [project1] => 0
    [project2] => 0
    [project3] => 0
    [project4] => 0
    [project5] => 0
    [project6] => 0
    [email] => info@mail.com
    [day] => 06/30/2013

)
   )

1 个答案:

答案 0 :(得分:0)

您可以简单地使用:

if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began)
{
    var ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
    RaycastHit hit;

    if (Physics.Raycast(ray, out hit, 20))
    {
        var evt = hit.collider.gameObject.GetComponent<GameEvent>();

        if (evt)
        {
            EventManager.RegisterEvent(evt);
            return;
        }
    }
}