PHP Data Structure Tutorials

This series of tutorials covers everything you need to know about arrays, objects and other compound data types in PHP.

1 5 Ways to Create an Array in PHP

2 Exploring Indexed and Associative Arrays in PHP

3 How to Access Array Elements in PHP

4 How to Append Elements to an Array in PHP

5 How to Insert an Element into an Array in PHP

6 How to Prepend an Element to an Array in PHP

7 How to Get the Length of an Array in PHP

8 4 Ways to Check if an Array is Empty in PHP

9 4 Ways to Iterate Over an Array in PHP

10 PHP Array Cheat Sheet: A Complete Reference

11 How to Reverse an Array in PHP

12 How to Remove an Element from an Array in PHP (7 Examples)

13 How to Update an Element in an Array in PHP

14 PHP Array Slicing: A Practical Guide

15 Ways to Calculate the Sum of an Array in PHP (7 examples)

16 3 Ways to Calculate the Product of an Array in PHP

17 4 Ways to Find the Average of an Array in PHP

18 Ways to Find Min/Max Values of an Array in PHP

19 How to Remove Empty Elements from an Array in PHP

20 Sorting Arrays in PHP: A Complete Guide (7 Examples)

21 Working with Nested Arrays in PHP

22 How to Filter an Array in PHP by a Condition

23 5 Ways to Merge Arrays in PHP (with Examples)

24 How to Find Common Elements in Two Arrays in PHP

25 PHP: How to remove the first/last element from an array

26 PHP: How to convert an array to an object and vice versa

27 PHP: How to sort an array of objects by property values

28 PHP: Sorting an array of arrays by key

29 How to check if an array contains a value in PHP

30 PHP: How to split an array into chunks

31 Reducing Arrays in PHP: A Practical Guide

32 How to Shuffle an Array in PHP

33 How to Get a Random Element from an Array in PHP

34 How to Find the Difference Between Two Arrays in PHP

35 PHP: How to Count the Occurrences of an Array Value

36 3 Ways to remove duplicates from an array in PHP

37 How to map two arrays into an object in PHP

38 PHP: How to remove all falsy values from an array

39 PHP: Removing all non-numeric characters from an array

40 PHP: How to convert an array to JSON and vice versa

41 How to Clear/Empty an Array in PHP (5 Approaches)

42 How to Deep Clone an Array in PHP

43 5 Ways to Create an Object in PHP (with Examples)

44 PHP: How to access properties and methods of an object

45 PHP: How to add new properties to an object

46 PHP: How to update the property value of an object

47 How to convert an object to JSON in PHP (serialization)

48 How to convert JSON to an object in PHP (parsing)

49 How to declare a class in PHP

50 PHP class static properties and methods: A complete guide

51 Understanding PHP class constructors: A practical guide

52 Understanding the 'this' keyword in PHP classes: A detailed guide

53 How to Declare Constants in PHP Classes

54 PHP class inheritance: A practical guide

55 PHP interfaces: A practical guide

56 PHP class destructors: A practical guide

57 PHP Object-Oriented Programming: A Complete Cheat Sheet

58 Using traits in PHP classes: A practical guide

59 Using interfaces in PHP classes: A complete guide

60 Exploring abstract classes in PHP: A practical guide

61 Anonymous Classes in PHP: A Practical Guide

62 How to Apply Polymorphism in PHP

63 How to Implement Method Overloading in PHP

64 How to Work with Visibility (Public, Private, Protected) in PHP

65 How to Implement Magic Methods in PHP

66 How to Create Singleton Classes in PHP

67 How to Implement Dependency Injection in PHP

68 How to Use Namespaces in PHP

69 How to Implement Method Chaining in PHP

70 How to Handle Exceptions in PHP Classes

71 How to Work with Final Classes and Methods in PHP

72 How to Create Immutable Objects in PHP

73 How to Implement Autoloading in PHP

74 Fixing PHP Fatal Error: Class Not Found

75 Fixing PHP parse error: syntax error, unexpected 'class' (T_CLASS)

76 Fixing PHP Fatal error: Cannot redeclare class

77 Fixing PHP Strict Standards: Declaration of method should be compatible

78 Fixing PHP Fatal Error: Call to Undefined Method (3 Solutions)

79 Fixing PHP class method warning: Missing argument

80 Fixing PHP Fatal error: Cannot instantiate abstract class

81 Fixing PHP Notice: Undefined property

82 Solving PHP Fatal error: Cannot access private property

83 Fixing PHP Warning: Illegal offset type

84 Fixing PHP Uncaught Error: Access to undeclared static property

85 Fixing PHP Fatal error: Interface not found

86 Fixing PHP Fatal error: Class 'MyClass' not found in (5 solutions)

87 Fixing PHP Strict Standards: Non-static method

88 Fixing PHP Fatal error: Nesting level too deep - recursive dependency (3 ways)

89 Fixing PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM

90 How to merge 2 objects in PHP

91 PHP: How to List All Properties and Methods of an Object

92 How to compare 2 objects in PHP

93 How to Compare 2 Arrays in PHP

94 How to iterate over an object in PHP

95 Traversable interface in PHP: A practical guide

96 stdClass in PHP: A Practical Guide

97 PHP Resource type: A practical guide

98 PHP callable type: A complete guide

99 PHP iterable type: A developer's guide

100 Using PHP Generator: A Practical Guide

101 PHP Algorithms: Weighted Random Selections

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

103 PHP SplFixedArray: A Practical Guide

104 PHP: Using classes from external namespaces

105 PHP: Using classes from third-party libraries

106 PHP: 3 Ways to Get N Random Elements from an Array

107 PHP: Calculate standard deviation & variance of an array

108 How to fix PHP notice: Undefined index

109 How to fix PHP warning: Undefined array key

110 How to fix PHP notice: Undefined offset

111 How to fix PHP error: Calling a member function on a non-object

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments