Tag

associative array

0 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
Sep 27, 2024 · Backend Development

Using mysqli_fetch_assoc to Retrieve Rows as Associative Arrays in PHP

This article explains how to connect to a MySQL database in PHP, execute a SELECT query, and use the mysqli_fetch_assoc function to fetch rows as associative arrays, including sample code and notes on handling multiple rows and error checking.

DatabasePHPSQL
0 likes · 4 min read
Using mysqli_fetch_assoc to Retrieve Rows as Associative Arrays in PHP
php中文网 Courses
php中文网 Courses
Aug 12, 2024 · Backend Development

Using PHP array() Function to Create Indexed and Associative Arrays

This article explains the PHP array() function, demonstrates how to create both indexed and associative arrays with clear examples, outlines important usage notes, and provides sample code for various array types to help developers master array creation in PHP.

PHParrayassociative array
0 likes · 5 min read
Using PHP array() Function to Create Indexed and Associative Arrays
php中文网 Courses
php中文网 Courses
May 28, 2024 · Backend Development

Using PHP’s array_flip() Function to Swap Keys and Values

This article explains PHP's array_flip() function, showing its syntax, behavior with duplicate values, and practical examples that demonstrate how to exchange array keys and values for tasks such as reverse lookups and data manipulation.

arrayarray_flipassociative array
0 likes · 5 min read
Using PHP’s array_flip() Function to Swap Keys and Values
php中文网 Courses
php中文网 Courses
Feb 18, 2024 · Backend Development

Using PHP array_shift() to Remove the First Element from an Array

This article explains the PHP array_shift() function, shows its syntax, demonstrates how it removes and returns the first element of both indexed and associative arrays, and highlights that the original array is re‑indexed after the operation.

PHParrayarray_shift
0 likes · 4 min read
Using PHP array_shift() to Remove the First Element from an Array
php中文网 Courses
php中文网 Courses
Nov 11, 2023 · Backend Development

Using PHP array_reverse() to Reverse Indexed and Associative Arrays

This article explains how PHP's array_reverse() function can reverse both indexed and associative arrays, provides clear code examples, shows the resulting output, and includes a brief summary of its usage for developers.

Code ExamplePHParray_reverse
0 likes · 5 min read
Using PHP array_reverse() to Reverse Indexed and Associative Arrays
php中文网 Courses
php中文网 Courses
Aug 11, 2023 · Backend Development

Using PHP krsort() to Reverse‑Sort Associative Arrays

This article explains the PHP krsort() function, its syntax, optional sorting flags, provides a step‑by‑step example of sorting an associative array in reverse order, discusses important considerations, and shows practical scenarios where reverse key sorting is useful in backend development.

PHPassociative arraybackend
0 likes · 4 min read
Using PHP krsort() to Reverse‑Sort Associative Arrays
php中文网 Courses
php中文网 Courses
Jul 17, 2023 · Backend Development

Understanding PHP's array_combine() Function: Syntax, Use Cases, and Code Examples

This article explains PHP's array_combine() function, detailing its syntax, parameters, return values, error handling, and demonstrates multiple practical applications such as creating and updating associative arrays, processing form data, and converting two‑dimensional arrays, with complete code examples.

PHParray_combineassociative array
0 likes · 4 min read
Understanding PHP's array_combine() Function: Syntax, Use Cases, and Code Examples
Laravel Tech Community
Laravel Tech Community
Mar 19, 2021 · Backend Development

PHP localtime() Function – Retrieve Local Time as an Array

The PHP localtime() function returns the local date and time as an array, optionally associative, mirroring the C library function, and accepts an optional Unix timestamp parameter, with examples showing both numeric and associative array outputs.

DateTimeLocalTimePHP
0 likes · 3 min read
PHP localtime() Function – Retrieve Local Time as an Array
Laravel Tech Community
Laravel Tech Community
Dec 18, 2020 · Backend Development

Using PHP key() to Retrieve Keys from Associative Arrays

This article explains the PHP key() function, its parameters and return values, and demonstrates with a complete example how to iterate over an associative array to output the keys whose values match a specific condition, such as finding all keys for the value "apple".

PHPTutorialassociative array
0 likes · 2 min read
Using PHP key() to Retrieve Keys from Associative Arrays