Questions tagged as 'array'

2
answers

Replace exact word in PHP array

I would like to know how I can replace exactly words in PHP , I currently have this: $string = "Despues de tomar no maneje, es mejor llamar un taxi"; $exceptions = array( "de" => "DE", "es" => "ES" ); $conver = str_repl...
asked by 08.11.2017 / 18:58
1
answer

Help with class instance that contains array of string

Hi, I have a class with an array as a variable: public string history; public string[] answers; public StoryNode[] nextNode; public bool isFinal = false; I want to create a reference in another class, as I must fill in the a...
asked by 09.10.2017 / 14:27
1
answer

PHP foreach put together a table

I have a page where I receive arrays by the _POST method from a form and I need to create a row with each group of data: $idfila = $_POST['idfila']; $destino = $_POST['destino']; $pedidohs = $_POST['pedidohs']; $pedido_desarrollo = $_POST['ped...
asked by 11.09.2017 / 16:46
1
answer

How to obtain specific data from an array that is stored in a Session in Laravel 5.1?

Greetings guys, the topic is simple I need to show in a view the data of an array that is in session, which contains several arrays. What I am doing is the following: This is how I update the array: public function inscribir(Evento $even...
asked by 08.07.2017 / 14:38
2
answers

get the data of an array in angularjs

I have the following array : vm.model= {"left":false,"middle":true,"right":false} From which I want to obtain the value of each item of the arrangement and save it in the Database , but I do not know how to obtain for example left...
asked by 25.06.2017 / 09:09
2
answers

How to insert multiple values of a checkbox in a table

I insert an array of a checkbox in a mysql table [seleccionael25] => Array ( [0] => Oximetros de pulso [1] => Linterna (Penlights) [2] => Repuestos Littmann [3] => Doppler fetal [4] =...
asked by 19.06.2017 / 03:35
2
answers

Help to store this data

I am interested in saving two types of data, String and int. I have to store numbers so that: int: 1/ String:"Uno" ... int: 89/ String:"Ochenta y nueve" I know that in other languages there are tuples, but I do not know how to store it in j...
asked by 26.05.2017 / 13:17
2
answers

Can you use array_unique exceeding a value of the array?

There is a possibility that array_unique take the elements you want from an array, for example, we have an array with keys and names, and we want to eliminate duplicate names by ignoring keys that may be different. I know there is no...
asked by 17.05.2017 / 12:37
1
answer

The if only recognizes me the last element of the array, what do I do?

function comenzar(){ var caja=document.getElementById("caja"); var numero=document.getElementById("numero"); numero.addEventListener("change",background,false); setInterval(background(),50); } function background(){ valores...
asked by 10.04.2017 / 17:49
1
answer

Extract text from a file in R

I have a .txt file with a fixed-length DNA string and I want you to return an array of text with different fragments. I read the file with the following code: dades<- read.table("DnaSeq.txt") Example: I have the string: tgcaggctt...
asked by 09.03.2017 / 10:27