Questions tagged as 'array'

2
answers

Use array type variable that returns from ajax function in PHP?

Ihavetogetavariabletypearrayofajaxanditisreturningcorrectlyuntilconsole.log(data);butI'mnotsurehowtousethereturnvariableinsidetheindex.phpfile.Index.php</!DOCTYPEhtml><html><head><linkrel="stylesheet" href="css/bootstrap.mi...
asked by 23.07.2018 / 17:11
1
answer

Toogle Select Function

I have the following scenario: I have a list of addresses that comes dynamically from the database, according to what is registered by the user. I need to enable only one address, so when one button is activated all other ones are disabled...
asked by 31.10.2018 / 08:27
1
answer

How to show the values and differences of arsort (); krsort (); ksort (); sort (); and etc in echos? [closed]

Exercise proposed by the teacher. C-) Create a function in PHP that feeds an array with notes from your sophomore year of college. Use the following array sorting commands and tell what each of these commands does. sort (), asort (), ksort ()...
asked by 09.04.2017 / 05:08
1
answer

Convert hash arrays

I'm giving some maintenance on a perl system (language that I'm noob) and I needed to create a new report module where I need to solve the following situation: I have 2 arrays with the following formats @head = ("nomeinstituicao", "cnpjinst...
asked by 28.07.2018 / 00:18
1
answer

Comparison of elements of a vector with stcmp

In the following function I want to compare the elements of an array of 1000, but I can not find a way to compare them successfully, even using strcmp() . void verifica_conta(int *ptr) { int i; //Posição for(i = 0; i < 1000;...
asked by 01.11.2017 / 04:43
1
answer

Change the size of the vector during the program?

I want to resize the vector to solve this problem "The Legend of Flavious Josephus": link If I have 5 people with a jump of 2 it will look like this: 12345 - > 2 and 4 died and in the next cycle, the 1 and 5 die. 135 - > I want...
asked by 23.08.2018 / 15:42
1
answer

How to organize matrix

A comparison is being made: This is so $result3 = array_diff($fetchForm, $items['form_id']); print_r($result3); Array ( [0] => 1 [2] => 3 ) $result2 = array_diff($items['form_id'], $fetchForm); print_r($r...
asked by 15.09.2014 / 23:52
1
answer

List all the data of an API in numerical list (Array)

I have this Array: [tracks] => Array ( [data] => Array ( [0] => Array ( [title] => Amiga Da Minha Mulher...
asked by 14.11.2018 / 09:02
2
answers

Query does not return fetch_array

I'm trying to make a query though, although the query works fine in PHPMyAdmin in the browser it returns the message below:    Fatal error: Call to undefined method PDOStatement :: fetch_array () in   D: \ xampp \ htdocs \ final \ inc \ proje...
asked by 25.01.2018 / 13:26
1
answer

Why is my array not ordered? (Bubble Sort)

I've fed the array with the user input, but the algorithm does not output it in an orderly way, what did I do wrong? int main() { // variáveis int vetor[5] = {0}; int aux, i=0, j=0; printf("Entre com numer...
asked by 21.09.2018 / 03:17