Skip to content

Tag: arrays

Counting entries in sub/subarray

I am working on a chat. I have an array that contains the info regarding the room (in the example below, 2 rooms (the lounge, the beach)). I have an issue when I have an empty room (in the example the beach), as it contains by default no user, (which is a Null user). I am trying to count, in

Transform text coma in an array

I am working with the PayPal API and I am trying to add multiple items to my itemList. My problem is that to make the itemList work, the array needs multiples variables: I am using a loop before, to set-up the items, which I am trying to gather into one variable: It doesn’t work and I think that the pro…

Count number of columns in array php?

I have a simple function to count numbers of columns with specific value in the array: it works well while accept exists in the array. If not I get Undefined index: Accept. My array looks like that: How can I add something like isset here? Answer With oneliner is it not possible (or the code will be messy), s…