All the PHP tutorials โคต๏ธ
-
PHP PDO Persistent Connections: Why I Turned Them Off
Persistent connections sound like free speed. I turned them on, got weird bugs, and turned them right back off. Here's what actually happens under the hood.
-
A Comprehensive Guide to Getting Started with PHP: Tips, Tricks, and Code Examples
If you're looking to start your journey with PHP, this guide is for you. PHP is a popular and widely used scripting language that is commonly used for building dynamic websites and web applications.
-
Installing PHP 8 on CentOS 7: A Comprehensive Guide
Installing PHP 8 on CentOS 7 using the Remi repository. Get the exact commands to enable the right repo and upgrade without a five hour battle.
-
Getting Started with PHP 8 on Ubuntu: A Step-by-Step Guide
The recent release of PHP 8, developers can expect significant improvements in performance, security, and functionality.
-
5 Tips for Optimizing Your PHP Code
I share five practical ways to optimize your PHP code, from data types to control structures, to improve performance without adding complexity.
-
Checking if file exists in PHP
file_exists() in PHP checks if a path is there, but it can hide directories. I show how to use is_file() for precise checks and handle permission edge cases.
-
Deleting a file in PHP
Unlink() is the simple PHP way to delete a file. I show how to call it, what it returns, and why it matters for cleanup scripts.
-
Writing to file with PHP
I show how to write to a file with PHP using fwrite and the w mode. You'll see why it overwrites old content and how to use a mode to append instead.
-
Reading the contents of files with PHP
Read file contents in PHP using fopen in r mode and fread. This simple snippet shows how to grab the full text by passing the file size to avoid partial reads.
-
PHP fopen() function
PHP fopen() opens files for reading or writing. I break down the 8 modes and explain exactly when to use each one so you stop guessing at file access.