This series of tutorials covers everything you need to know about arrays, objects and other compound data types in PHP.
- 15 Ways to Create an Array in PHP
- 2Exploring Indexed and Associative Arrays in PHP
- 3How to Access Array Elements in PHP
- 4How to Append Elements to an Array in PHP
- 5How to Insert an Element into an Array in PHP
- 6How to Prepend an Element to an Array in PHP
- 7How to Get the Length of an Array in PHP
- 84 Ways to Check if an Array is Empty in PHP
- 94 Ways to Iterate Over an Array in PHP
- 10PHP Array Cheat Sheet: A Complete Reference
- 11How to Reverse an Array in PHP
- 12How to Remove an Element from an Array in PHP (7 Examples)
- 13How to Update an Element in an Array in PHP
- 14PHP Array Slicing: A Practical Guide
- 15Ways to Calculate the Sum of an Array in PHP (7 examples)
- 163 Ways to Calculate the Product of an Array in PHP
- 174 Ways to Find the Average of an Array in PHP
- 18Ways to Find Min/Max Values of an Array in PHP
- 19How to Remove Empty Elements from an Array in PHP
- 20Sorting Arrays in PHP: A Complete Guide (7 Examples)
- 21Working with Nested Arrays in PHP
- 22How to Filter an Array in PHP by a Condition
- 235 Ways to Merge Arrays in PHP (with Examples)
- 24How to Find Common Elements in Two Arrays in PHP
- 25PHP: How to remove the first/last element from an array
- 26PHP: How to convert an array to an object and vice versa
- 27PHP: How to sort an array of objects by property values
- 28PHP: Sorting an array of arrays by key
- 29How to check if an array contains a value in PHP
- 30PHP: How to split an array into chunks
- 31Reducing Arrays in PHP: A Practical Guide
- 32How to Shuffle an Array in PHP
- 33How to Get a Random Element from an Array in PHP
- 34How to Find the Difference Between Two Arrays in PHP
- 35PHP: How to Count the Occurrences of an Array Value
- 363 Ways to remove duplicates from an array in PHP
- 37How to map two arrays into an object in PHP
- 38PHP: How to remove all falsy values from an array
- 39PHP: Removing all non-numeric characters from an array
- 40PHP: How to convert an array to JSON and vice versa
- 41How to Clear/Empty an Array in PHP (5 Approaches)
- 42How to Deep Clone an Array in PHP
- 435 Ways to Create an Object in PHP (with Examples)
- 44PHP: How to access properties and methods of an object
- 45PHP: How to add new properties to an object
- 46PHP: How to update the property value of an object
- 47How to convert an object to JSON in PHP (serialization)
- 48How to convert JSON to an object in PHP (parsing)
- 49How to declare a class in PHP
- 50PHP class static properties and methods: A complete guide
- 51Understanding PHP class constructors: A practical guide
- 52Understanding the ‘this’ keyword in PHP classes: A detailed guide
- 53How to Declare Constants in PHP Classes
- 54PHP class inheritance: A practical guide
- 55PHP interfaces: A practical guide
- 56PHP class destructors: A practical guide
- 57PHP Object-Oriented Programming: A Complete Cheat Sheet
- 58Using traits in PHP classes: A practical guide
- 59Using interfaces in PHP classes: A complete guide
- 60Exploring abstract classes in PHP: A practical guide
- 61Anonymous Classes in PHP: A Practical Guide
- 62How to Apply Polymorphism in PHP
- 63How to Implement Method Overloading in PHP
- 64How to Work with Visibility (Public, Private, Protected) in PHP
- 65How to Implement Magic Methods in PHP
- 66How to Create Singleton Classes in PHP
- 67How to Implement Dependency Injection in PHP
- 68How to Use Namespaces in PHP
- 69How to Implement Method Chaining in PHP
- 70How to Handle Exceptions in PHP Classes
- 71How to Work with Final Classes and Methods in PHP
- 72How to Create Immutable Objects in PHP
- 73How to Implement Autoloading in PHP
- 74Fixing PHP Fatal Error: Class Not Found
- 75Fixing PHP parse error: syntax error, unexpected ‘class’ (T_CLASS)
- 76Fixing PHP Fatal error: Cannot redeclare class
- 77Fixing PHP Strict Standards: Declaration of method should be compatible
- 78Fixing PHP Fatal Error: Call to Undefined Method (3 Solutions)
- 79Fixing PHP class method warning: Missing argument
- 80Fixing PHP Fatal error: Cannot instantiate abstract class
- 81Fixing PHP Notice: Undefined property
- 82Solving PHP Fatal error: Cannot access private property
- 83Fixing PHP Warning: Illegal offset type
- 84Fixing PHP Uncaught Error: Access to undeclared static property
- 85Fixing PHP Fatal error: Interface not found
- 86Fixing PHP Fatal error: Class ‘MyClass’ not found in (5 solutions)
- 87Fixing PHP Strict Standards: Non-static method
- 88Fixing PHP Fatal error: Nesting level too deep – recursive dependency (3 ways)
- 89Fixing PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
- 90How to merge 2 objects in PHP
- 91PHP: How to List All Properties and Methods of an Object
- 92How to compare 2 objects in PHP
- 93How to Compare 2 Arrays in PHP
- 94How to iterate over an object in PHP
- 95Traversable interface in PHP: A practical guide
- 96stdClass in PHP: A Practical Guide
- 97PHP Resource type: A practical guide
- 98PHP callable type: A complete guide
- 99PHP iterable type: A developer’s guide
- 100PHP: How to find the mode(s) of an array (4 examples)
- 101PHP Algorithms: Weighted Random Selections
- 102Using PHP Generator: A Practical Guide
- 103PHP SplFixedArray: A Practical Guide
- 104PHP: Using classes from external namespaces
- 105PHP: Using classes from third-party libraries
- 106PHP: Calculate standard deviation & variance of an array
- 107PHP: 3 Ways to Get N Random Elements from an Array
- 108How to fix PHP notice: Undefined index
- 109How to fix PHP warning: Undefined array key
- 110How to fix PHP notice: Undefined offset
- 111How to fix PHP error: Calling a member function on a non-object