1

I'm trying to push some data into a multidimensional array, but can't find the correct syntax anywhere.

array_push($price, $row["ShopID"], $row["URL"]);

This is my code so far, but this does not make the array multidimensional, it just inserts each item as an individual row in the array. How can I fix this, and make the array multidimensional?

1
  • 1
    Wrap both values into an array before you push it?! Commented Sep 17, 2016 at 11:15

1 Answer 1

0

Are you pushing an array? Then:

array_push($price, array($row["ShopID"], $row["URL"]));

or maybe:

 array_push($price, $row);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.