php

  • How to transform a Json String into a DTO in PHP

    In PHP, a DTO (Data Transfer Object) is a design pattern that is used to transfer data between different layers or components of an application. It acts as a container or data structure that holds the data.The

    ...
  • How to UPDATE data in MySQL from PHP

    Updating data in a MySQL database using PHP involves using the UPDATE statement. Here are some examples of how to perform updates using PHP:

    Assuming you have a

    ...
  • How to upgrade to php 8+ from older versions

     Upgrading old PHP code to the new 8 series could be a very difficult task, but its absolutely necessary. Main reasons are security, performance and compatibility. I will try to document here things I haven't found

    ...
  • How to upload a file in php symfony framework

    MostPHP Software Applications require to provide the user the capability of uploading images, pdf and other types of documents. With Symfony, this implementation is very easy and simple, just follow this

    ...
  • How to use array_column function in php

    array_column(array, column_name) is another very powerful function available in PHP. It allows to extract all the values from the specified column from a multi-dimensional array without looping into each one of the nested arrays. These are the

    ...
  • How to use array_filter function in PHP

    array_filter(callable, array1) is another very powerful function available in PHP. Basically is a way to remove elements from an array that does not pass given rules in the callable function. These are the most common ways to implement this

    ...
  • How to use array_map function in PHP

    array_map(callable, array1,array2,array3,...) is a very powerful function available in PHP. Basically is a way to transform one or more arrays applying the logic in the callable function and output the result as another array. These are the most

    ...
  • How to use Redis from PHP

    Before you proceed, make sure you have Redis installed and running on your server. You'll also need to install the PHP Redis extension. If you haven't installed it yet, you can do so using the following command:

    ...
  • How to validate input data in Symfony using DTOs

    Data validation is one of the most important parts of all Software Applications. If you are using PHP Symfony Framework, you have available a very powerful yet easy to use validator* component that validates objects

    ...
  • How to work with Date Intervals in PHP

    The DateInterval class is used to represent a duration or interval between two dates. It allows you to work with dates in a more granular and flexible way. The DateInterval class is part of PHP's

    ...
  • Install PHP7 with FPM in a Vagrant Centos 7

    Once you have installed and configured your Vagrant Virtual Machine with Linux Centos 7 follow these simple steps to get up and running PHP7-FPM (Fast Page Manager):

    Step 1. Once you vagrant up the VM, vagrant ssh to

    ...
  • Installing Joomla 4 on Ubuntu 22 with PHP 8: A Step-by-Step Guide

    Joomla is a popular and powerful content management system (CMS) that allows you to build and manage websites with ease. The latest version, Joomla 4, comes with numerous improvements and new features. In this article, we will guide you through

    ...
  • Installing PHP Zend OP Cache Viewer

    Zend OP Cache is key in having a very high performance Software Application running in PHP.

    A good way to see how it is working, which files are cached and more, is using this very nice PHP

    ...
  • Most Common Design Patterns Used in PHP Programming

    Design patterns are reusable solutions to commonly occurring problems in software development. They provide a structured approach to designing and organizing code, improving maintainability, scalability, and code readability. In PHP programming,

    ...
  • Most Common Sorting Algorithms used in PHP

    Sorting is one of the most important tasks to be executed by computers. These examples show the implementation in PHP of the most commonly used algorithms for sorting data.

    Nginx Configuration for High Performance Web Sites

    Modern PHP Enterprise Systems Applications require high efficient fast loading web sites. These are the key concepts you must configure in your Nginx Web Server to have a high performance web application:

    - Enable

    ...
  • Nginx with PHP-FPM in Vagrant Centos 7 Virtual Machine

    PHP Fast Page Manager allows to execute PHP Code very fast. The best way to have a high performance site is to pair it with Nginx Web Server.

    Prerequisites:

    ...

  • PHP Data Types

    As many other languages, PHP handles many different data types. Data types and their correct use are key for implementing a very Robust Enterprise Class PHP Application.

    Prerequisites:

    ...
  • Practical Usages of Interfaces in PHP

    Interfaces in PHP are used to define a contract or a blueprint for classes. They provide a way for developers to define a set of methods that a class must implement. The practical usages of interfaces in PHP are as

    ...
  • Sample Listener implementation in Symfony 5+

    Event Driven Architecture is a very powerful pattern for modern PHP Enterprise Systems Applications. In Symfony is very easy to implement actions that are executed when a particular type of event happens using listeners.

    Let's say you

    ...