Skip to content
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

Programming Tutorial

Start Learning to Code

  • About Us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

Breaking News

Nextjs: running code after complete fetch

why does 400 status code result always entercatch block execution with axios?

Saving the state of the button onClick

TypeScript: Specify that value must be in Array using spread operator

Show separate number with comma in django tempalte

Why does my website keep showing old index.html, style.css, app.js…?

Using Python Flask to change the colour of an icon when it detects a words like scam, pending and verified

x clear icon appears only when the input has value – react

Login button redirects to two pages. For first time loginers, it redirects to agreement page, and for rest, it redirects straight to home?

WebComponent setter not triggered if defer is used

Tag: php

Arrays

walk through array with nested output in PHP

admin June 21, 2021

I have this code: foreach ($_POST as $key1 => $item1): if (is_array($item1)): foreach ($item1 as $key2 => $item2): if (is_array($item2)): foreach ($item2 …

array-walkarraysphp
Arrays

target a subarray using a variable and move it to the top of main array

admin June 21, 2021

two-dimensional array need to target the subarray where key id is equal to a variable $id and move that target array at the top of main array $id = 2; $rows = Array( [0] => Array( [id] => 1 [0]…

arraysphp
Arrays

Map array with initial letter in PHP

admin June 20, 2021

I wish to group a word list in an array with the initial letter. function alpha($str) { $result[substr($str,0,1)] = $str; return $result; } $a = [‘abc’,’cde’,’frtg’,’acf’]; $b = array_map(‘…

arraysphp
Arrays

PHP updating multiple elements of sub-array of MongoDB document

admin June 17, 2021

I have the following document structure. I am trying to update specific values inside the holes sub-array: Each holes Array element is an Object representing the score on a golf hole, with various …

arraysmongodbphp
Arrays

how to sort php multidimensional array by other array

admin June 4, 2021

I have an array with IDs that looks like $order_ids = array(8,9,10,4,7); and another multidimensional array that looks like array( 0 => array( 0 => 4, // order id …

arraysmultidimensional-arrayphp
Arrays

php make new array from old array

admin June 3, 2021

I have some cases where I need to do a split item for my shipment from items order. the rule is max weight per 1 shipment is 5. this is my items order : $items = [ [ “sku” =…

arraysphp
Linux

Apache Server is down after PHP upgrade from PHP

admin June 2, 2021

I have updated the PHP from PHP 5.6 to PHP 7.4. After the updated web Server apache, is down. The Error is “httpd: Syntax error on line 39 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 …

apachelinuxphpsysadmin
Arrays

Retrieve values from deep array PHP

admin April 21, 2021

I have a 3 deep array. Currently, the code will isolate a record based on one field ($profcode) and show the heading. Eventually, I am going to build a table showing the information from all the other …

arraysphp
Arrays

Sorting subarray by lastname

admin April 14, 2021

I have an array that I have sorted by year within which I have arrays with a lastname key. I am looking to sort these subarrays by lastname. I managed to classify by year. But the arrays inside are …

arraysphp
Arrays

$_POST array empty in php after submission of a form using a formData

admin March 21, 2021

I’ve seen several posts about the issue but none of them solved my problem. I’m working with XAMPP and I have an html index.html and a php remote.php in the same folder. The formData which I want to …

arraysformsjavascriptphppost

Posts navigation

1 2 … 140 Next
Privacy Policy