php

  • How to convert Time Zones in PHP

    Date calculations are probably one of the most challenging requirements for PHP Developers.  Some of these are timezone calculations. Here are some examples on how to use the DateTime and DateTimeZone classes available in PHP core to deal with

    ...
  • How to deal with large data collections in Symfony Doctrine Entity

    When we learn to use Doctrine's ORM correctly, we can have a very powerful tool that allows us to get things done in very short time.

    Before continue, you may want to check on this previous posts:

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

    Examples of using PHP to perform a DELETE operation in MySQL. Before running these examples, make sure you have established a connection to your MySQL database using the appropriate

    ...
  • How to deserialize and validate nested Dtos in Symfony 6+

    DTOs (Data Transfer Objects) are very useful for handling complex data structures. In PHP Symfony is very easy to deserialize and validate complex deep nested json or xml strings passed in the body of an Api Http

    ...
  • How to encrypt and decrypt data in PHP Symfony 6+

    Keeping data protected and safe is key in modern Enterprise Software Applications. In PHP we have available the openSSL extension to be bundled with it1. When developing Symfony Applications you can follow this simple

    ...
  • How to Execute Linux Commands from PHP

    PHP has a wide range of capabilities, including the ability to execute Linux commands directly from PHP scripts. This functionality allows PHP developers to interact with the underlying operating system, execute system commands, and retrieve the

    ...
  • How to generate a JWT json web token in symfony framework.

    JWT or Json Web Tokens are becoming the standard for Authentication in Http REST Api calls. In Symfony we have the lexik/jwt-authentication-bundle available as a package that allow us to manage jwt in a very easy

    ...
  • How to generate and handle sessions in PHP

    To generate and handle sessions in PHP, you can use the built-in session handling functions provided by PHP. Sessions allow you to store and retrieve data across multiple requests for a particular user.

     

    Starting a

    ...
  • How to generate and set cookies in php 8

    To generate and set cookies in PHP 8, you can use the setcookie() function. This function allows you to set the necessary attributes of a cookie, such as the name, value, expiration time, path, domain, and more. Here's an

    ...
  • How to generate and validate JWT in PHP without any existing package

    To generate and validate JWT without using any existing package in PHP, you'll need to understand the structure and components of a JWT, and implement the necessary logic yourself. Here's a detailed explanation

    ...
  • How to generate Pdf Documents in Symfony 5+

    Most modern Enterprise Systems require to generate reports, agreements, business plans or a variety of documents that can be downloaded in PDF format. Pdf is one of the most popular file formats used for document sharing as it has a small file

    ...
  • How to generate WSDL file in Symfony with NelmioApiDocBundle

    To generate a WSDL file in Symfony using the NelmioApiDocBundle, you can follow these steps:

     

    Step 1: Install the NelmioApiDocBundle

    Ensure you have the

    ...
  • How to get a jwt passing username and password in Symfony?

    Modern Enterprise Software Applications are implemented with a backend following the Http Rest Api pattern. Each request must include an "Authorization" header with a Bearer Token as value. JWT tokens are becoming the more secure way to

    ...
  • How to get Sorted results from a To Many Relation in Symfony Entity

    Doctrine's Object Relational Mapper and the Entity classes provide us developers a very easy way to deal with Table associations. When we define a One To Many / Many To One Table association, the best way to query results is from the One To Many

    ...
  • How to implement a pub - sub pattern in php

    Implementing the Publish-Subscribe (Pub-Sub) pattern in PHP involves creating a system where publishers send messages (events) to a central event bus, and subscribers receive and handle those events. This pattern decouples the publishers from

    ...
  • How to implement Actions that respond to Events in PHP Symfony

    One of the most powerful features of Symfony Framework is its Event Driven Architecture. It is very easy and simple to implement PHP logic that responds to certain events during the request - response cycle.

    How to implement and use Symfony's ParamConverter

    Symfony ParamConverter is a very powerful feature provided by the Symfony framework that allows you to automatically convert route parameters into objects or other data types.Typically is declared

    ...
  • How to implement Arrow Functions in PHP

    Arrow functions, also known as short closures, were introduced in PHP 7.4 as a more concise syntax for defining anonymous functions. They provide a shorthand way to create simple, one-line functions without the need for the function keyword or

    ...
  • How to implement autowiring in PHP using DI Container

    In PHP, autowiring refers to a technique for automatically resolving dependencies when instantiating classes. To implement autowiring in PHP, you can use a dependency injection container, such as PHP-DI package, which provides autowiring out of

    ...
  • How to implement autowiring in php using reflexion class

    Autowiring in PHP refers to the ability to automatically resolve dependencies of a class without the need for manual instantiation or injection of dependencies.To implement autowiring in PHP using the ReflectionClass, you can follow these

    ...