Home » 2022 » February

Searching JavaScript Arrays with the Array.find() Method [Examples]

Javascript Array find()

This tutorial will show you how to search arrays in JavaScript using the Array.find() method, and show some code examples. JavaScript Arrays An array is a type of variable that holds an ordered list of values (or references to other variables), called array elements. Each element has a position in the array, called the index – and can be accessed by using that index. We’ve got a whole pile of things you can do with JavaScript arrays. Accessing elements in the array by their index is convenient, … Read more

Home » 2022 » February

How to Write/Save to a File with PHP [Examples]

PHP Write/Save File

This tutorial will demonstrate how to write data to a file on the server in the PHP programming language. Code examples are provided to show you how it’s done. Writing data to a file server-side is a common task. Whether you’re writing log files so you can debug your app, or saving user submitted data, you will need to save a file at some point in your web development career. Writing data to a file in PHP is a three-step process. You must first open … Read more

Categories PHP

Home » 2022 » February

Ultimate Guide to Uploading Multiple Files With PHP [Examples]

PHP Multiple File Uploads Ultimate Guide

This tutorial will explain how to upload one or multiple files from the web browser to the server using PHP. Code examples are included, including the code for limiting file size and type. Being able to have your users upload files to your app has become expected functionality in most web apps. Photos, filled out PDF forms, videos, recordings – any kind of file can be uploaded, and the process is relatively straight forward. PHP provides all of the required tools for file uploading and … Read more

Categories PHP

Home » 2022 » February

How to Resize/Crop Images in PHP with the GD Library

PHP Resize/Crop Image

This tutorial will show you how to resize or crop images in the PHP programming language. Code examples are provided which can be copy and pasted into your project. GD Library vs ImageMagick Image resizing in PHP is performed by an optional image processing library. The two most popular image processing libraries for PHP are GD and ImageMagick. Both work well, but I’ll be sticking to the GD Library for this tutorial as it is the most popular and supported. Installing the GD PHP Extension The GD library … Read more

Categories PHP

Home » 2022 » February

Multidimensional/Nested Arrays in JavaScript [Guide]

Multidimensional/Nested Arrays in JavaScript

This guide aims to succinctly show you how multidimensional arrays can be created and used in the JavaScript programming language. What are Arrays? Arrays are a key component in any app kind of app you may wish to build – arrays allow you to store an ordered list of variables or values of any length in a single variable – ready to be iterated over, displayed, or otherwise processed. For example, an array could contain a list of contacts for an instant messaging application, or … Read more

Home » 2022 » February

How to Rename Files & Directories in PHP [Examples]

PHP Rename File

This tutorial will show you to rename files and folders in PHP with the rename() function – including some code examples you can use in your own project. We’ve already covered uploading files and deleting files in PHP, read on to find out how to rename them. rename() PHP Function Syntax The syntax for the rename() function used to delete files in PHP is as follows: rename($FROM, $TO, $CONTEXT) Note that: $FROM is the path of the existing file you wish to rename $TO is the new path you wish to rename … Read more

Categories PHP

Home » 2022 » February

How to Set up AdBlock DNS Ad Blocking in OpenWRT

Setting Up Adblock Ad Blocking on OpenWRT

This tutorial will walk you through setting up DNS level Ad Blocking on your network by installing Adblock on an OpenWrt router. If you’re looking to set up an OpenWrt router of your own, check out our guide to setting up OpenWrt on a repurposed BT HomeHub. What is OpenWrt? OpenWrt is a Linux-based operating system designed to be run on routers and other embedded devices. It’s a full computer OS so you can do whatever you want with it, but its primary use (and … Read more

Home » 2022 » February

Output or Display an Image in the Browser from PHP

PHP Output Image File

This article will show you how to output or display an image in the web browser from PHP, with a quick copy & paste code snippet. Images in PHP We’ve covered how to resize images in PHP using the GD library. Once an image is created, it can be saved or returned to the browser to be displayed without saving it. Outputting/Displaying an Image in PHP without Saving it The following PHP code snippet creates an image object and returns it without saving it: // The header() function is … Read more

Categories PHP

Home » 2022 » February

How to Set up a Samba/SMB Windows Share in OpenWrt with LuCi

OpenWRT Samba SMB Share LuCi

This super quick tutorial will show you how to set up a Samba/SMB Windows network share on an OpenWrt device. This tutorial works best if you have some extra storage available for your file share – check out our article on adding extra USB storage to OpenWrt here. What is Samba? Samba is a file sharing package which provides network file shares compatible with the SMB and CIFs protocols used by Windows. Install Dependencies/Packages You will need to install two packages to set up the network … Read more

Home » 2022 » February

How to Locate the PHP.ini Configuration File [Linux/Ubuntu]

Locate PHP ini configuration

Here’s a quick tip on how to locate the php.ini configuration file which is currently in use by PHP on your system or web host. Locate PHP.ini From the Command Line You can usually find out which php.ini file PHP is pulling its configuration from from the command line. The php -i command will print the information about your current PHP environment and grep will filter that output to only lines containing the string ‘Configuration File’, including it’s location: php -i | grep ‘Configuration File’ Finding the PHP.ini Configuration in Use for … Read more

Categories PHP