Creating Global Helper Functions in Hyperf for Quick Access to Core Components
Registering Helper Functions via Composer Autoload
In Hyperf applications, you can create global helper functions to access core components more conveniently. These functoins provide shortcuts to services like Redis, caching, logging, and WebSocket connections.
Creating the Helper File
Create a helper file that defines global functions for acce ...
Posted on Sat, 18 Jul 2026 16:45:10 +0000 by willpower
PHP Workers in RoadRunner: Configuration and Usage Guide
PHP Workers
To execute your PHP application, you need to create a worker endpoint and configure RoadRunner to utilize it. First, install the required packages using Composer:
composer require spiral/roadrunner nyholm/psr7
The simplest entry point using the PSR-7 server API looks like this:
<?php
use Spiral\RoadRunner;
use Nyholm\Psr7;
in ...
Posted on Sat, 18 Jul 2026 16:24:08 +0000 by jronyagz
PHP Form Handling: GET, POST, and User Input Processing
Demonstrates how to submit and retrieve form data using the GET method.
echo "<h3?>
Welcome, " . $userName . "!"; echo "You are a " . ($gender === 'male' ? 'boy' : 'girl') . "!"; } ?> Experiment 2: Handling Form Data with POST Method
Demonstrates how to submit and retrieve form data using t ...
Posted on Sat, 18 Jul 2026 16:14:12 +0000 by kjharve
Understanding PHP's Garbage Collection and Memory Management Mechanisms
In PHP versions prior to 5.3, memory cleanup relied solely on basic reference counting without a dedicated garbage collector (GC). It simply checked if a variable’s zval (Zend value container) had a refcount of 0; if so, it freed the memory, otherwise it retained the block until the PHP process terminated. This naive approach worked for simple ...
Posted on Fri, 17 Jul 2026 16:24:36 +0000 by MasK
CTFshow RCE Extreme Challenge Solutions
Direct use echo with backticks. First ls, then tac to read the flag.
Challenge 2
The filter is quite restrictive. One effective method is the character increment bypass. A small script can enumerate which characters are allowed:
for ($c = 32; $c < 127; $c++) {
if (!preg_match("/[a-zA-Z0-9@#%^&*:{}\-<\?>\"|`~\\\\]/&q ...
Posted on Wed, 15 Jul 2026 16:55:59 +0000 by Ellypsys
Laravel Homestead Environment Setup Guide
Installing VirtualBox and Vagrant
Before setting up your Homestead development environment, you need to install VirtualBox (https://www.virtualbox.org/wiki/Downloads) and Vagrant (http://www.vagrantup.com/downloads.html). Both applications offer straightforward graphical installation packages compatible with major operating systems. Download Vi ...
Posted on Wed, 15 Jul 2026 16:09:14 +0000 by EPJS
Comprehensive PHP and Go Interview Questions from Major Tech Companies
Echo Technology First Round
Kafka Multiple Partitions Ensuring Message Order
Initially sending messages can be achieved by specifying key + single partition
When multiple consumers process data, you can take modulo of the key and place it into queues, then use multiple threads to consume these queues. Queues maintain internal order
MySQL W ...
Posted on Sun, 12 Jul 2026 17:26:35 +0000 by Topper
Exporting Data to Excel with PHPExcel in ThinkPHP 5
This guide details the process of integrating PHPExcel for data export functionality within a ThinkPHP 5 application.
Setup
Download PHPExcel: Obtain the latest version of PHPExcel from its official GitHub repository: https://github.com/PHPOffice/PHPExcel.
Directory Structure: After downloading and extracting the PHPExcel archive, create a new ...
Posted on Sun, 12 Jul 2026 17:25:07 +0000 by chiprivers
Generating Word Documents from HTML Content in PHP
Overview of MHT-Based Document Generation
Creating native Microsoft Word documents directly from PHP can be complex without heavy external libraries. A lightweight alternative involves generating files in the MHT (MIME HTML) format. Modern versions of Microsoft Word can open MHT files seamlessly, allowing developers to treat them as .doc files. ...
Posted on Fri, 10 Jul 2026 16:44:58 +0000 by w.geoghegan
Building a PHP Student Management System with PDO and MySQL
Database Setup
Before implementing the application, set up the MySQL database and table structure:
CREATE DATABASE IF NOT EXISTS student_db;
USE student_db;
CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
gender VARCHAR(10),
interests VARCHAR(100),
location VARCHAR(50),
notes TEXT
) ...
Posted on Wed, 08 Jul 2026 17:01:00 +0000 by v1ral