You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive collection of PHP practice scripts covering core programming concepts, data structures & algorithms (DSA), Object-Oriented Programming (OOP), string & array manipulation, and common coding interview problems.
📁 Repository Structure
php-coding-practice/
│
├── 📂 oops/ # Object-Oriented Programming (OOP) concepts
│ ├── abstract.php # Abstract classes and methods
│ ├── encapsulation.php # Encapsulation & Data Hiding (private properties, getters/setters)
│ ├── inheritance.php # Class inheritance and constructor overriding (`parent::__construct`)
│ ├── index.php # Access modifiers (`protected` method access in child classes)
│ └── oops.php # Class, object instantiation, and `__construct` lifecycle
│
├── 📂 questions/ # Problem-solving & interview coding questions
│ ├── countVowels.php # Vowel counter in strings using OOP approach
│ ├── palindrome.php # Palindrome string checker (custom reversal logic)
│ ├── secondSmallest.php # Find 2nd smallest element in an array (bubble sort logic)
│ ├── smallest_missing.php # Find the smallest missing positive integer
│ ├── str_alpha.php # Alphabetical sorting of characters in a string
│ ├── str_ch_count.php # Character frequency counter in a string
│ ├── sum_of_even.php # Sum of all even numbers in an array
│ └── sumOfEvenSquares.php # Sum of squares of even numbers in an array
│
├── 📂 table/ # Mini Interactive Web Projects
│ └── index.php # Dynamic Multiplication Table Generator (Bootstrap 5 + PHP Form)
│
├── array_short.php # Custom Bubble Sort algorithm for arrays
├── array_unique.php # Custom unique array values filter (without `array_unique`)
├── compare_array.php # Array comparison, unique merging, and duplicate counter
├── implode_explode.php # String splitting and array joining (`explode` / `implode`)
├── index.php # PHP basics ($ vs $$, echo vs print, strict comparison)
├── ip_address.php # Client IP detection (HTTP headers & REMOTE_ADDR)
├── isPrime.php # Prime number finder (1 to 100)
├── pattern.php # Star & number pattern generators (Pyramid, Right Triangle)
├── power.php # Iterative power calculation ($x^y$ with negative exponent support)
├── recursive_function.php # Recursive power calculation ($base^{exponent}$)
├── searching_array.php # Linear search implementation in arrays
├── space_cal.php # Space character counter in strings
└── string_rev.php # Word-level string reversal without built-in functions