AnyCompiler

Free · No signup

PHP Tutorial

Learn PHP from the ground up — a server-side, web-first scripting language built around the $ sigil, loose vs strict comparison, and the associative array as its one workhorse collection, used as both a list and a dictionary. Every code example on every lesson is real and runnable — the output shown was captured from an actual execution on this site's own compiler, not typed by hand — and you can try each one yourself with one click.

  1. 1Introduction to PHP
  2. 2Your First PHP Program
  3. 3Variables and Types
  4. 4Strings
  5. 5Numbers and Operators
  6. 6Arrays
  7. 7Associative Arrays
  8. 8Control Flow
  9. 9Loops
  10. 10Functions
  11. 11The Null Coalescing Operator
  12. 12Closures and Arrow Functions
  13. 13Classes and Objects
  14. 14Visibility and Encapsulation
  15. 15Inheritance
  16. 16Interfaces and Traits
  17. 17Working with Strings and Arrays Together
  18. 18Error Handling

More lessons are added regularly. Want to practice outside the tutorial? Open the PHP compiler. Prefer Hindi? Hindi mein padhein. Prefer Urdu? Roman Urdu mein parhein. Prefer Spanish? Leer en español. Prefer Portuguese? Ler em português. Prefer R? Read the R tutorial. Prefer Ruby? Read the Ruby tutorial. Prefer Perl? Read the Perl tutorial. Prefer Bash? Read the Bash tutorial. Prefer Swift? Read the Swift tutorial. Prefer Kotlin? Read the Kotlin tutorial. Prefer Java? Read the Java tutorial. Prefer C#? Read the C# tutorial. Prefer C++? Read the C++ tutorial. Prefer C? Read the C tutorial. Prefer Rust? Read the Rust tutorial. Prefer Go? Read the Go tutorial. Prefer TypeScript? Read the TypeScript tutorial. Prefer JavaScript? Read the JavaScript tutorial. Prefer Python? Read the Python tutorial.