Questions tagged as 'array'

1
answer

Array conversion into string

I have the following array as I transform it into a string. This string would be used to save the products of the shopping cart in MySQL. Then they have several snacks and products: products 5,2,5 use this code implode(',', $adicion...
asked by 23.09.2014 / 06:30
2
answers

If array is the same as pointer, why does one need to be copied to one variable and another need not?

In this answer bigown said that if the frame member was a pointer you do not need to copy the string into it. But arrays are not pointers? Why is it different?     
asked by 02.02.2017 / 12:35
2
answers

Difference between two Multidimensional Arrays with PHP

I have these two multidimensional arrays and would like the difference between them, similar to what the array_diff function does, but with multidimensional arrays: $array_1: Array ( [0] => Array ( [...
asked by 19.07.2014 / 23:28
3
answers

Select higher PHP value

I have the following: $gols = array("Kraken"=>"25", "Cleiton.Xavier"=>"10", "Buffon"=>"0", I wanted to find the highest value of $gols and the name of the player also how do I?     
asked by 19.11.2018 / 12:33
1
answer

Formatting stdClassObject for array

I have a problem converting some data to my system, I have the following code snippet that returns an array with a few objects: Array( [4014] => stdClassObject([id] => 4014[registro] => 9877[sigla] => total) [4006] => st...
asked by 04.08.2016 / 17:06
2
answers

Array copy in ADVPL

In ADVPL what's the difference: aArray1 := {"A", "B", "C"} aArray2 := aArray1 or aArray2 := aClone(aArray1)     
asked by 18.08.2016 / 22:02
2
answers

Initializing Array of a new class

Considering two classes in C #: public class aClass { public string afield; } public class bClass { public aClass[] bfield; } I want to start the variable as bClass cVar = new bClass(); cVar.bfield[0].afield = "text"; but is g...
asked by 05.04.2018 / 21:40
3
answers

Store value and quantity PHP array

I need to scan the first array and store the value and amount of that value in another array . I'm not getting it because I'm having difficulty storing the values in another array . Array : array(5) { [0]=> array(...
asked by 09.11.2016 / 12:36
1
answer

I can not search the words in brackets in php

I've created a function to check if some words exist in an array. I want to do the word search inside brackets "[]". Example: [as], [dar], [amar] ... For this, I'm using the preg_match () function to check if any of the words in the array exi...
asked by 28.08.2015 / 00:31
3
answers

Split array and sort

I have an array as follows: 'Ato001_1981', 'Ato002_1980', 'Ato003_1982', 'Ato003_1983', 'Ato004_1982', 'Ato013_1981', 'Ato013_1982', 'Ato013_1988', 'Ato031_1982', 'Ato032_1979', 'Ato039_1988', 'Ato060_1987', 'Ato065_1988', 'Ato066_1988', 'Ato0...
asked by 18.09.2015 / 15:02