Remove elements in a row of an array

This question already has an answer here:

  • PHP: Delete an element from an array 34 answers

  • foreach($search as $item) {
        unset($item['tag']);
        echo json_encode($item);
    }
    

    你可以通过unset()


    您可以在json_encode之前从数组中移除该元素

    foreach($search as $item) {
        unset($item['tag']);
        echo json_encode($item);
    }
    
    链接地址: http://www.djcxy.com/p/30102.html

    上一篇: PHP从数组中删除元素

    下一篇: 删除数组中一行的元素