Questions tagged [Arrays] (807)

2
answers

How to get minimum value of an array with its name?

Hello, I need code which will return 2 values, namely "the name of the string array" and "Meaning of this string" For example: <?php $xml = simplexml_load_file("xml.xml"); $dates = array(); foreach($xml as $line){ $dlg = array(".", ",", ":", " "); replaced = str_replace($dlg, "", $line->name); $rdate = date(d.m....
Madisyn0 asked April 19th 20 at 11:51
1
answer

How to record values from a mysql query in php variables?

Database structure: There is here such request: $query2 = "SELECT `id`,`date`,`delta0`,`delta1` FROM `counter` ORDER BY `id` DESC LIMIT 7"; Out of the last 7 values from the database. You need to read into variable $date all date values separated by commas, in the variable $dayhot all values of delta0, separated by commas,...
catharine.Bins asked April 18th 20 at 13:20
0
answer

How to move a object from one array to another condition?

Help me to finished my code to make it work the way I would like. I have an array of arrays (let's call them containers), they are already sorted by maximum weight for the container 3300. Prerequisite: you must start from array C to move the object from the container B into container C, if the container C has an empty sea...
columbus.Ankunding asked April 18th 20 at 13:10
2
answers

How to fill out mnogomernyi array?

Everything was going smoothly until one day, on me fell the task to draw from x's one big x. I was able to make it through the cycle, but the teacher said to try to use in this task, a multidimensional array, and then I was confused. class Loader { public static void main(String[] args) { int size = 7; String [] [] ...
Larissa asked April 18th 20 at 12:43
2
answers

How does the clone() method in java?

Hello. I have some classes containing methods transform(int[] board), changing different array. They are United in one interface (Transform). In Main create an array of Transform objects and using loop I want to show various changes of the array, but that it was clearly, I want the change do not overlap each other. The coac...
alexis asked April 18th 20 at 12:38
2
answers

How to combine array with a loop?

There is an array of the form: The current array You need to do: The destination array The array is of the form: Line 61array(3) { [0]=> array(50) { [0]=> array(2) { ["ID"]=> string(4) "7112" ["TITLE"]=> string(7) "Tester1" } .. [49]=> array(2) { ["ID"]=> string(4) "7014" ["TITLE"]=> string(7) ...
christophe_Mills56 asked April 18th 20 at 12:35
1
answer

How to choose the id of the queue?

Welcome! There are several userid, for example they look like this: $users = [1,2,3,4,5]; $lastuser = 1; The task is the following: from the array $users I take one id and send him some data, then this ID I write down in $lastuser. Now the question is - as with $lastuser me from the array to select the next id? For examp...
Thea67 asked April 18th 20 at 12:14
3
answers

How to sort an array of date in the form m.Y?

There are here such arrays: array(29) { ["03.2020"]=> array(4) { ["likes"]=> int(46003) ["comments"]=> int(2663) ["reposts"]=> int(2939) ["views"]=> int(3386015) } ["01.2020"]=> array(4) { ["likes"]=> int(8958) ["comments"]=> int(612) ["reposts"]=> int(404) ["views"]=> int(699785) } ["02.202...
noemy asked April 16th 20 at 10:38
1
answer

How to find the index of the element one-dimensional array name by name?

Hello. The essence of the problem - there is an array with the names of all employees: for example string [] array = { "Ivanov Ivan Ivanovich", "Sidorov Sidor Sidorovich", "Petrov Pyotr Petrovich",}; need to do a search by name, so if you enter from the keyboard: Ivanov, the returned full name. As I understand it, it is ...
Isidro_Pfeffer0 asked April 16th 20 at 10:27
3
answers

How to swap rows with columns of matrix in Java?

Hello, it is impossible to write an algorithm that would rearrange the rows and columns in a two-dimensional array. Help, please. Is only able to change the first row first column: for (int i = 0; i < array.length; i++) { int j = 0; int box = board[i][j]; board[i][j] = board[j][i]; board[j][i] = box; j++; }
clifford.Walk asked April 16th 20 at 10:15