Posts
PHP Downloading With file_get_contents()
In this code snippet, we’ll learn how to perform file downloads in PHP with the file_get_contents() function. The file_get_contents() function gets/downloads a file(locally or from the web) as a string…
PHP Force File Download
In this code snippet, we’ll learn how to force file downloads in PHP…
PHP Data Validation
In this code snippet, we’ll learn how to perform data validation in PHP. Data validation is used to make sure the input data is present and in the correct format…
PHP dirname() Function
In this code snippet, we’ll learn about the dirname() function in PHP. The dirname() function takes in a path string and gives you the parent directory of it. A second parameter…
PHP Request Variables
In this code snippet, we’ll learn how to get HTTP request variables in PHP. When an HTTP request is made to the PHP backend the data associated with the request(POST body, GET url…
PHP Pass By Reference
In this code snippet, we’ll learn how to pass and work with variables by reference in PHP. Variables can be passed either by value or by reference. Usually, we do…
PHP Working With Strings
In this code snippet, we’ll learn how to work with strings in PHP. More specifically we’ll learn how to concatenate(join) strings, trim white spaces, make a string lower or upper…
PHP Working With Arrays
In this code snippet, we’ll learn how to work with arrays in PHP. More specifically we’ll learn how to merge arrays, add/remove elements, reverse the array, remove duplicates, search the…