Skip to main content

All Questions

0 votes
0 answers
34 views

Convert 2d Array in to Needed format

I need to convert the below 2dimentional array into specified 2d array format. Array contains the id followed by multiple parent and multiple sub category fields array. Also, I have tried to convert ...
Sardharmohamed M's user avatar
-2 votes
1 answer
40 views

Output of multidimensional arrays in PHP [duplicate]

i want to get the lowest value of an array(). Now I have 2 problems: Problem 1: I can't define a 2D Array and get a illegal offset error. Problem 2: When i found the lowest value I need to know who it ...
RetSIN's user avatar
  • 13
0 votes
2 answers
50 views

Convert 2d array by specified 2d format

I need to convert the below 2d array in to specified 2d array format. Array contains multiple parent and multiple child array. Also, have tried to convert the code, but am not getting the expected ...
Sardharmohamed M's user avatar
0 votes
1 answer
173 views

sessions in "Add to cart" php - Webcart

session_start(); $aaa=$_REQUEST['bb']; $_SESSION['bookrec']=array( 'book1'=>array('callno'=>123005,'price'=>number_format(1380,2),'desc'=>'Attack on Titan ...
MN Narvaez's user avatar
1 vote
1 answer
47 views

2d matrix, 2 points given, find third one at a certain distance, PHP

Good day all. I'm doing a simple script in PHP, I'm having problems about a simple geometrical problem: I have a 2d matrix, width=10000 and its height = 6000. I have 2 points, A(2000,1000) and B(3400,...
Matteo Bononi 'peorthyr''s user avatar
1 vote
1 answer
871 views

bubble sort multidimensional array php

I have to sort 2d array $items = array( array(15, 16, 8, 1), array(2, 3, 4, 7), array(9, 11, 19, 6,) ); with bubble sort ant to get something like this 1,2,3,4 6,7,8,9 11,15,16,...
deizi23's user avatar
  • 35
0 votes
1 answer
249 views

How would I sort a multidimensional array to make a "tree" in PHP

How would I sort or iterate a multi-dimensional array so that it forms a tree like structure (all children after each parent) such as: Parent #1 Child #1 Child #2 Parent #2 Child #1 Parent #3 Child ...
user2137980's user avatar
-3 votes
2 answers
1k views

PHP: Accessing two dimensional array from a function

Hello I can not figure out how to access a two dimensional array returned by a function. My function query($query) inside a Connection class(inside Connection.php): public function query($query) { ...
Yasuf's user avatar
  • 1