Tag

PHP

0 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
Jun 13, 2025 · Backend Development

How to Transform Legacy PHP Code into a Clean, Testable Architecture

Legacy PHP applications often suffer from spaghetti code, global state abuse, mixed concerns, and lack of tests; this guide outlines a step‑by‑step refactoring strategy—adding a testing safety net, introducing dependency injection, separating concerns with MVC/DDD, adopting repository patterns, and leveraging modern tools like Composer and PHPStan—to evolve them into maintainable, testable, and scalable backend systems.

DDDPHPbackend development
0 likes · 6 min read
How to Transform Legacy PHP Code into a Clean, Testable Architecture
php中文网 Courses
php中文网 Courses
Jun 13, 2025 · Backend Development

How to Build a Real-Time Camera Filter App with PHP and JavaScript

This tutorial walks you through installing PHP‑GD and Video4Linux, creating a web page that previews the webcam using getUserMedia, adding a filter selector, and processing the image on the server with PHP‑GD to apply real‑time visual effects.

GD LibraryImage ProcessingJavaScript
0 likes · 9 min read
How to Build a Real-Time Camera Filter App with PHP and JavaScript
php中文网 Courses
php中文网 Courses
Jun 13, 2025 · Backend Development

Master PHP’s file() Function: Read Files into Arrays with Flags

Learn how to use PHP’s built‑in file() function to read a text file into an array, control newline handling with FILE_IGNORE_NEW_LINES, skip empty lines with FILE_SKIP_EMPTY_LINES, and see practical code examples illustrating each option.

BackendPHParray
0 likes · 4 min read
Master PHP’s file() Function: Read Files into Arrays with Flags
php中文网 Courses
php中文网 Courses
Jun 12, 2025 · Backend Development

Mastering PHP curl_errno(): Retrieve and Handle cURL Error Codes

Learn how to use PHP's curl_errno() function to obtain cURL request error codes, understand common error numbers, and implement robust error handling with practical code examples that initialize a cURL handle, execute requests, check for errors, and close the handle.

BackendError HandlingPHP
0 likes · 4 min read
Mastering PHP curl_errno(): Retrieve and Handle cURL Error Codes
php中文网 Courses
php中文网 Courses
Jun 12, 2025 · Backend Development

Master PHP’s ftell(): How to Get File Pointer Position with Code Examples

This article explains how to use PHP's ftell() function to retrieve the current file pointer position, covering its signature, parameters, return values, and providing a practical code example that reads the first ten bytes of a file and displays the pointer offset.

PHPbackend developmentfile handling
0 likes · 4 min read
Master PHP’s ftell(): How to Get File Pointer Position with Code Examples
php中文网 Courses
php中文网 Courses
Jun 11, 2025 · Backend Development

How to Retrieve the First Key of an Array in PHP with array_key_first()

Learn how to use PHP's array_key_first() function introduced in PHP 7.3 to obtain the first key of an array, see syntax, example code, handling empty arrays, and fallback to array_keys() for older PHP versions.

BackendFunctionsPHP
0 likes · 3 min read
How to Retrieve the First Key of an Array in PHP with array_key_first()
php中文网 Courses
php中文网 Courses
Jun 11, 2025 · Backend Development

Master PHP’s array_unique(): Remove Duplicates and Sort Arrays Efficiently

Learn how to use PHP’s array_unique() function to eliminate duplicate values from arrays, understand its parameters—including optional sort flags—and see practical code examples that demonstrate deduplication and sorting for both string and numeric arrays.

BackendPHParray_unique
0 likes · 4 min read
Master PHP’s array_unique(): Remove Duplicates and Sort Arrays Efficiently
php中文网 Courses
php中文网 Courses
Jun 11, 2025 · Backend Development

PHP vs WordPress: Which Should Power Your Next Web Project?

An in‑depth comparison of PHP and WordPress examines their strengths, weaknesses, ideal use cases, performance and security considerations, and shows how developers can choose or combine them based on project requirements, team expertise, and long‑term maintenance goals.

BackendCMSPHP
0 likes · 8 min read
PHP vs WordPress: Which Should Power Your Next Web Project?
php中文网 Courses
php中文网 Courses
Jun 10, 2025 · Backend Development

How to Automate Architecture Testing in PHP Projects for Cleaner Code

This article explains what architecture testing is, why PHP projects need it, introduces tools like Deptrac, PHPArch and PHPMD, shows common testing scenarios, and provides best practices for integrating automated architecture tests into CI/CD pipelines to improve code quality and maintainability.

CI/CDPHPStatic Analysis
0 likes · 6 min read
How to Automate Architecture Testing in PHP Projects for Cleaner Code
php中文网 Courses
php中文网 Courses
Jun 10, 2025 · Backend Development

Master PHP’s is_resource(): Detect Resource Types with Real Code Examples

This article explains how PHP's is_resource() function checks whether a variable represents an external resource such as a file handle, database connection, or image, and provides clear code samples demonstrating its practical use in each scenario.

Code ExamplesPHPbackend development
0 likes · 4 min read
Master PHP’s is_resource(): Detect Resource Types with Real Code Examples
php中文网 Courses
php中文网 Courses
Jun 10, 2025 · Backend Development

Build Real-Time Video Chat with PHP and WebRTC: Step-by-Step Guide

This tutorial walks you through creating a real-time video chat web app using PHP on the server side and WebRTC in the browser, covering environment setup, server code, client implementation, and how to run the application.

PHPReal‑Time CommunicationWeb Development
0 likes · 6 min read
Build Real-Time Video Chat with PHP and WebRTC: Step-by-Step Guide
php中文网 Courses
php中文网 Courses
Jun 9, 2025 · Backend Development

Master PHP Getters and Setters: Boost Data Safety and Flexibility

This article explains PHP getters and setters, detailing their purpose, implementation, and benefits with clear code examples, helping developers enhance data encapsulation, validation, and overall code reliability in backend applications.

PHPbackend developmentdata encapsulation
0 likes · 6 min read
Master PHP Getters and Setters: Boost Data Safety and Flexibility
php中文网 Courses
php中文网 Courses
Jun 9, 2025 · Backend Development

Master Advanced Dependency Injection Techniques in Modern PHP

This article explores the core concepts, benefits, and advanced implementations of Dependency Injection in modern PHP, covering constructor, setter, and interface injection, autowiring, contextual and lazy injection, container patterns like factories, decorators, conditional registration, and best practices for performance, testing, and integration with other design patterns.

PHPbackend developmentdependency injection
0 likes · 6 min read
Master Advanced Dependency Injection Techniques in Modern PHP
php中文网 Courses
php中文网 Courses
Jun 9, 2025 · Backend Development

Master PHP’s is_file(): Check Files and Paths Like a Pro

This article explains how the PHP is_file() function works, shows its syntax, and provides clear code examples for checking whether a given path exists and is a regular file, while also noting its limitations and the alternative is_dir() function.

PHPTutorialbackend development
0 likes · 3 min read
Master PHP’s is_file(): Check Files and Paths Like a Pro
php中文网 Courses
php中文网 Courses
Jun 6, 2025 · Backend Development

Why Native PHP Beats Frameworks: Performance, Simplicity, and Real‑World Use Cases

This article explains why writing native PHP code can outperform full‑stack frameworks by offering superior performance, a gentler learning curve, and easier maintenance, and it provides practical examples such as simple output, form handling, PDO database queries, and file uploads.

BackendNative PHPPHP
0 likes · 4 min read
Why Native PHP Beats Frameworks: Performance, Simplicity, and Real‑World Use Cases
php中文网 Courses
php中文网 Courses
Jun 6, 2025 · Backend Development

Master PHP’s str_split(): Split Strings into Characters Easily

Learn how to use PHP’s str_split() function to divide strings into individual characters or custom-sized chunks, with clear syntax explanations, practical examples—including splitting “Hello World” and generating numeric codes—plus tips for handling default and optional parameters.

BackendCode ExamplesPHP
0 likes · 4 min read
Master PHP’s str_split(): Split Strings into Characters Easily
php中文网 Courses
php中文网 Courses
Jun 6, 2025 · Backend Development

Master PHP Accessors & Mutators: Boost Data Handling with Real Code Examples

This article explains PHP accessors and mutators, shows how to implement them with practical code, and demonstrates advanced uses such as data validation, range limiting, and caching to create more robust and maintainable backend applications.

AccessorsMutatorsPHP
0 likes · 7 min read
Master PHP Accessors & Mutators: Boost Data Handling with Real Code Examples
php中文网 Courses
php中文网 Courses
Jun 5, 2025 · Backend Development

What Exciting New Features Will PHP 8.5 Bring to Developers?

PHP 8.5 introduces a suite of enhancements focused on developer experience, including an expanded constructor property promotion with default values and readonly, smarter match expressions with pattern matching, a native pipe operator for fluent function chaining, stricter never return type handling, faster autoloading and OPcache, plus new standard library functions such as str_contains_all and improved array_key_first/last.

8.5BackendFeatures
0 likes · 7 min read
What Exciting New Features Will PHP 8.5 Bring to Developers?
php中文网 Courses
php中文网 Courses
Jun 4, 2025 · Backend Development

Detecting Duplicate Elements in an Array with PHP

This article explains how to determine whether an integer array contains any duplicate values using a PHP solution that iterates the array, stores seen elements in an associative map, and returns true on the first repeat, with O(n) time and space complexity.

Duplicate DetectionPHPSpace Complexity
0 likes · 4 min read
Detecting Duplicate Elements in an Array with PHP