Add an element in a mass without an index



  • Hello.

    How do you add an element to the mass php without an index?

    <?php
    $array = array();
    array_push($array, array("cid"=> 1, "title"=> 2));
    //, == $array[] = array("cid"=> 1, "title"=> 2);
    ?>
    

    Array
    (
        [0] => Array
            (
                [cid] => 1
                [title] => 0
            )
    )
    

    I need you to.

    Array
    (
        Array
            (
                [cid] => 1
                [title] => 0
            )
    )
    

    i.e. without index



  • Without an index, the element cannot be added to the mass. But you can always have your index number or text.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2