Skip to content

A collection of 20 essential PHP programs commonly asked in technical interviews covering strings, arrays, loops, and OOP basics. Perfect for quick revision and practice.

Notifications You must be signed in to change notification settings

Abhinavsathyann/PHP-Technical-Interview-Programs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🐘 PHP Technical Interview Programs

A collection of 20 essential PHP programs commonly asked in technical interviews β€” covering strings, arrays, loops, and basic OOP concepts.


πŸ“š Topics Covered

  • String manipulation
  • Array operations
  • Mathematical logic
  • File handling
  • Object-Oriented Programming (OOP)
  • Database connection basics

🧠 List of Programs

No Program Name Description
1 reverse_string.php Reverse a given string
2 palindrome_check.php Check if a string is a palindrome
3 factorial.php Calculate factorial of a number
4 prime_number.php Check whether a number is prime
5 fibonacci_series.php Print Fibonacci series up to n terms
6 sum_of_digits.php Find sum of digits of a number
7 swap_numbers.php Swap two numbers without using a third variable
8 armstrong_number.php Check if a number is an Armstrong number
9 check_even_odd.php Determine if a number is even or odd
10 find_largest_number.php Find the largest among three numbers
11 array_sort.php Sort an array in ascending order
12 array_reverse.php Reverse elements in an array
13 count_vowels.php Count vowels in a string
14 string_word_count.php Count number of words in a string
15 remove_duplicates_array.php Remove duplicates from an array
16 file_read_write.php Demonstrate file read and write operations
17 simple_calculator.php Perform basic calculator operations (+, -, *, /)
18 class_object_demo.php Create a simple PHP class and object
19 inheritance_demo.php Example of inheritance in PHP
20 database_connection.php Basic MySQL database connection example

βš™οΈ How to Run

  1. Install PHP on your system (version 8+ recommended).
  2. Clone this repository:
    git clone https://github.com/Abhinavsathyann/php-technical-interview-programs.git
    cd php-technical-interview-programs/programs
  3. Run any program:
    php factorial.php
    
    

About

A collection of 20 essential PHP programs commonly asked in technical interviews covering strings, arrays, loops, and OOP basics. Perfect for quick revision and practice.

Topics

Resources

Stars

Watchers

Forks

Languages