PHP

PHP is a popular scripting language for web development. It can create dynamic and interactive web pages by running on the server and sending HTML to the browser. It is free, fast, and flexible,

An introduction to WeakMap in PHP (6 examples)

Updated: February 20, 2024 By: Guest Contributor

Introduction PHP introduced WeakMap in version 8.0, making a significant move towards more efficient memory management for applications. A WeakMap allows us to associate values to objects in…

Explore Attributes (Annotations) in Modern PHP (5 examples)

Updated: February 20, 2024 By: Guest Contributor

Introduction With the advent of PHP 8.x, the language introduced a game-changing feature known as Attributes, or previously known in other languages as Annotations. This significant addition brought…

Type Declarations for Class Properties in PHP (5 examples)

Updated: February 20, 2024 By: Guest Contributor

Introduction Type declarations, also referred to as type hints, allow developers to specify the expected data type of an argument in a function declaration, a return type from…

Nullable (Optional) Types in PHP: A practical guide (5 examples)

Updated: February 20, 2024 By: Guest Contributor

Overview In the evolving landscape of web development, PHP has remained a cornerstone for backend technologies. As applications grow in complexity, handling the absence of values or the…

Static Return Type in PHP: Explained with examples

Updated: February 20, 2024 By: Guest Contributor

Introduction In the ever-evolving world of PHP, the introduction of static return types in PHP 8.0 marks a significant milestone towards a more robust and type-safe programming style….

PHP: Using DocBlock comments to annotate variables

Updated: February 20, 2024 By: Guest Contributor

Introduction When it comes to making your code more understandable and maintainable, proper documentation can never be overemphasized. PHP, being one of the most popular server-side programming languages,…

PHP: How to ping a server/website and get the response time

Updated: February 19, 2024 By: Guest Contributor

Introduction Pinging a server is a network utility command (ping) that checks if a host is reachable. It is a diagnostic tool used to test the connectivity and…

PHP: 3 Ways to Get City/Country from IP Address

Updated: February 19, 2024 By: Guest Contributor

Overview Discovering the geographical location of a user based on their IP address can be very useful for various web applications. Be it for localizing content, implementing geo-restrictions,…

PHP: How to find the mode(s) of an array (4 examples)

Updated: February 19, 2024 By: Guest Contributor

Introduction Finding the mode of an array — the value(s) that appears most frequently — can be a common task in data processing and analytics with PHP. Unlike…

PHP: Calculate standard deviation & variance of an array

Updated: February 19, 2024 By: Guest Contributor

Introduction Understanding how to calculate the standard deviation and variance of an array in PHP is crucial for any developer working with datasets, as it helps in understanding…

1 2 3 4 95