Tips & Tutorials

Very Simple PHP MYSQL JSON Examples (A Beginner’s Guide)

Welcome to a beginner’s tutorial and examples of JSON in PHP and MYSQL. So you have probably heard of this “JSON” thing somewhere and wondering what it is for? JSON stands for Javascript Object Notation. In simple terms, we use JSON to convert an array into a string and vice-versa. JSON encode – Turn an …

Very Simple PHP MYSQL JSON Examples (A Beginner’s Guide) Read More »

How to Build a PHP Plugin Module System (Step-By-Step Example)

Welcome to a tutorial and example on how to create a PHP plugin module system. So you have a project that has grown massively large and needs to get things done in an organized manner. The general steps and considerations for developing a plugin system are: First, develop a core system that has a set …

How to Build a PHP Plugin Module System (Step-By-Step Example) Read More »

Get & Set Timezone In PHP Date (Simple Examples)

Welcome to a tutorial on how to get and set the timezone in PHP. Working on an international project and have to deal with the timezones? To get and set the timezone in PHP: To get and set the system default timezone: Change the date.timezone directive in the php.ini file, or use date_default_timezone_set(TIMEZONE) in the …

Get & Set Timezone In PHP Date (Simple Examples) Read More »

PHPSpreadsheet Quickstart – A Beginner’s Tutorial

Welcome to a beginner’s tutorial on PHPSpreadsheet. So you are interested in generating Excel files straight from your PHP project and stumbled on PHPSpreadsheet… But the documentation is overwhelming and there’s not a good place to get started with. Fret not. Let us walk through how to create a “hello world” spreadsheet in this tutorial, …

PHPSpreadsheet Quickstart – A Beginner’s Tutorial Read More »

3 Ways To Remove Line Breaks In PHP – Simple Examples

Welcome to a quick tutorial on how to remove line breaks in PHP. Need to get rid of all line breaks from a string? Remove some extra ones? The common ways to remove line breaks in PHP are: $nobreak = str_replace([“\r”, “\n”], “”, $STRING); $nobreak = preg_replace(“/\r|\n/”, “”, $STRING); $nobreak = trim($STRING); That should cover …

3 Ways To Remove Line Breaks In PHP – Simple Examples Read More »