I’ve got something I think it is a 3 dimensional array: So there are 2 arrays packed inside the variable. First is separated by | the second one by , What I need to do is: separate them and then check for an ID located before the name and give me single variables of the rest. I tried it like
Tag: arrays
Error converting Json string to array of objects PHP
I made a post in a form converting my javascript localstorage to a post request. From there I tried to decode my json string to make an object in PHP. How my php code looks before I echo it $…
Nearest array element by key in reverse order
I have custom code where I get nearest user from array by array key: $users = [ “4” => “John”, “7” => “Alex”, “13” => “Smith&…
How can send entire php array values on button click?
I want to send entire array information by the button click event, basically I store all information in the session send it on button, the problem is that just one value of array sent from session …
Simplify PHP array with same items
I have this PHP array: $this->user_list = array( 0 => ‘Not paid’,1 => ‘Not paid’, 2 => ‘Not paid’, 7 => ‘Waiting, 15 => ‘Waiting’, 10 => ‘Cancelled’ ); How can I simplify …
How to count related word from a list of word separated with comma
Hello i am trying to count number of related word from a list of words that are separated with comma. In short i am try to work with tags and i want to get the first word and count it similar words. …
PHP Array for hard multilevel items
i have this array structure and i want to create other array structure with that: Each array item have a group of characteristics like: I need an array that have this values like Azul=>64GB=>Plastico 128GB=>Cristal if sub item repeats only write the children value Azul=>64GB=>Cristal Only adds Cristal because 64GB exists I have this code in php: Where $arrCaracteristicas have
PHP: Storing arrays within an array seems to be creating copies
This is such a basic question, but I’m unable to find a clear answer anywhere. As I have understood it, storing an object in an array should store a reference, not a copy… so any changes you make to the object subsequently should be visible when you access the object via the array. When searching this topic, I’ve run across
Create a dynamic array from PHP &_POST for checked boxes to use in a foreach loop
I’m trying to use form data posted from another page as $_POST. The data contains an email and file paths which are held as values in check boxes. What I’m trying to achieve is to send an email for each of the selected files as an attachment. I already have the working as an array but this just sends all
PHP Group PDO or JSON results by 3 fields and output
I’m trying to group my results in an array by the 3 fields delivery_date, van_no and drop_no, this is what i have so far: // Gets all orders and sorts by delivery date, van and drop number $…