Questions tagged as 'array'

2
answers

PHP - Problem with Array ()

I have the following code $patron = '/{usuario}/photos/{photo_id}/comments/{comment_id}'; $array_patron = str_split($patron); $array3 = array(); $variable_open = false; $ind = -1; foreach($array_patron as $i => $val){ if($val === '{'){...
asked by 09.08.2017 / 22:21
1
answer

Tour PHP two-dimensional arrangement

I need to go through an arrangement $data that is as follows: array(2) { [0]=> object(stdClass)#18 (4) { ["Descripción"]=> string(5) "Aceite" ["Codigo"]=> string(7) "2222222" ["Precio"]=> strin...
asked by 11.05.2017 / 18:27
2
answers

How to go through this array

I have this array, in this way let's say putting the offset which is the 0 . Manually works what I want is that you return all the values of that array without me putting the offset $data_array[$section_key][$sect...
asked by 23.11.2016 / 18:52
4
answers

How to divide an array into two?

How to divide this array into two independent arrays of whatever length. Between the two arrays they must contain all the students, without any of them repeating themselves. Thanks var alumnos =["Carlos","Clara","Cristina","Fernando","Ivan","L...
asked by 18.12.2017 / 18:58
3
answers

Create an array from a for

I am trying to create the contents of an array from a for loop. I leave you with the code: $prodlang = $wpdb->get_results("SELECT * FROM wp_post WHERE wp_pedmin!=0"); $tama= count($prodlang); $product_min_qty = array( for($i=0...
asked by 29.01.2017 / 13:54
3
answers

Interactive Mode V / S Ide Python

One question; Why do I do this in interactive mode from python and from "spyder / ninja" does not work? Python »> from numpy import * »> a = array([10,20,30,40]) »> append(a,50) array([10, 20, 30, 40, 50]) »> Spy...
asked by 21.06.2016 / 00:14
1
answer

Code error: lvalue required as left operand of assignment

Why am I getting this: lvalue required as left operand of assignment In this line of code: original[0] = 100; The code I have is this: #include <iostream> #include <queue> #include <list> using namespace std; struc...
asked by 26.11.2018 / 20:47
1
answer

Problem with FOR loops

I'm trying to simplify the content of the movement function () to two loops, but doing it in loops does not do anything to me. My code is as follows: int movimimiento(){ mueve_servo(&patas[1][1], mov_home[1][1]); mueve_servo(&p...
asked by 11.11.2018 / 22:00
1
answer

How can I access the attributes of this object in javascript?

I am rendering configurations in an app, so from ajax I get this object. When I try to read it I can not because I do not know what the syntax is for doing it. res.data.0-MenuComponent res.data.'0-MenuComponent' try with those two...
asked by 27.09.2018 / 23:40
1
answer

Replace data from an array with a new PHP

The exercise I am doing is to make an interface of a theater which contains 5 rows and 5 seats or chairs. the user can make a series of actions between which they are Book, Release and Buy ("R", "L" and "V"). Well the problem is this: w...
asked by 19.07.2018 / 01:10