PHP: The Complete Course
Build dynamic websites with PHP: forms, sessions, files, object-oriented code and MySQL databases.
76 lessons≈ 21 hInstructor: Ngahtech AcademyUpdated 22 November 2026
What you will learn
- Write PHP with variables, strings, arrays, conditions, loops and functions
- Handle and validate forms safely, with sessions and cookies
- Read and write files and handle errors with exceptions
- Write object-oriented PHP with classes, interfaces, traits and namespaces
- Use databases with PDO and prepared statements
- Build secure, dynamic websites and JSON APIs
A complete, free 76-lesson PHP course, from your first echo to secure, database-driven websites.
Every lesson explains one topic with clear examples, has a Try it yourself editor that runs real PHP 8.4 in your browser, and ends with exercises and answers. Later modules cover forms and validation, sessions and cookies, files, object-oriented PHP, PDO with MySQL, JSON APIs and security. Take the HTML course first if you are new to web pages.
Requirements
- Basic HTML (see HTML: The Complete Course)
- A computer or smartphone with a web browser
Curriculum
Module 1: Getting started 6 lessons
- 1. What is PHP?Free preview 10 min
- 2. Installing PHP and running pagesFree preview 15 min
- 3. Syntax, echo and printFree preview 15 min
- 4. CommentsFree preview 10 min
- 5. Variables and scopeFree preview 15 min
- 6. Constants and magic constantsFree preview 10 min
Module 2: Data types, strings and numbers 7 lessons
- 7. Data types and var_dumpFree preview 15 min
- 8. StringsFree preview 15 min
- 9. String functionsFree preview 15 min
- 10. Modifying, slicing and comparing stringsFree preview 10 min
- 11. NumbersFree preview 10 min
- 12. Casting and type jugglingFree preview 15 min
- 13. Math functionsFree preview 10 min
Module 3: Operators and control flow 9 lessons
- 14. OperatorsFree preview 15 min
- 15. Comparison and logical operatorsFree preview 15 min
- 16. if, elseif and elseFree preview 15 min
- 17. Ternary, short if and nested conditionsFree preview 10 min
- 18. switchFree preview 10 min
- 19. matchFree preview 10 min
- 20. while and do...while loopsFree preview 10 min
- 21. for and foreach loopsFree preview 15 min
- 22. break and continueFree preview 10 min
Module 4: Functions 5 lessons
- 23. FunctionsFree preview 15 min
- 24. Arguments: defaults, named, variadic and by referenceFree preview 15 min
- 25. Return types and strict typesFree preview 15 min
- 26. Static variables and recursionFree preview 10 min
- 27. Anonymous functions, arrow functions and callbacksFree preview 15 min
Module 5: Arrays 8 lessons
- 28. Indexed arraysFree preview 15 min
- 29. Associative arraysFree preview 15 min
- 30. Adding, updating and removing array itemsFree preview 15 min
- 31. Looping through arraysFree preview 10 min
- 32. Sorting arraysFree preview 15 min
- 33. Multidimensional arraysFree preview 15 min
- 34. Array functionsFree preview 20 min
- 35. Practice: processing class resultsFree preview 25 min
Module 6: Regular expressions, dates and JSON 3 lessons
- 36. Regular expressionsFree preview 20 min
- 37. Dates and timesFree preview 15 min
- 38. JSONFree preview 15 min
Module 7: Forms, sessions and the web 10 lessons
- 39. How PHP handles a requestFree preview 15 min
- 40. SuperglobalsFree preview 15 min
- 41. Form handling with GET and POSTFree preview 20 min
- 42. Form validation and htmlspecialcharsFree preview 20 min
- 43. Practice: a complete formFree preview 25 min
- 44. include and requireFree preview 15 min
- 45. CookiesFree preview 15 min
- 46. SessionsFree preview 20 min
- 47. FiltersFree preview 15 min
- 48. File uploadsFree preview 20 min
Module 8: Files and errors 4 lessons
- 49. Reading filesFree preview 15 min
- 50. Writing files and foldersFree preview 15 min
- 51. ExceptionsFree preview 20 min
- 52. Error reporting and debuggingFree preview 15 min
Module 9: Object-oriented PHP 11 lessons
- 53. Classes and objectsFree preview 20 min
- 54. Constructors and destructorsFree preview 15 min
- 55. Access modifiers and encapsulationFree preview 15 min
- 56. InheritanceFree preview 20 min
- 57. Class constants and static membersFree preview 15 min
- 58. Abstract classesFree preview 15 min
- 59. InterfacesFree preview 20 min
- 60. TraitsFree preview 15 min
- 61. Namespaces and Composer autoloadingFree preview 20 min
- 62. Iterables and generatorsFree preview 15 min
- 63. Enums and readonly classesFree preview 15 min
Module 10: Databases with PDO 8 lessons
- 64. Databases and PDOFree preview 20 min
- 65. Creating tablesFree preview 15 min
- 66. Inserting data and the last IDFree preview 15 min
- 67. Prepared statementsFree preview 20 min
- 68. Selecting and fetching dataFree preview 20 min
- 69. Updating and deleting dataFree preview 15 min
- 70. TransactionsFree preview 15 min
- 71. Practice: a CRUD applicationFree preview 30 min
Module 11: XML, APIs, security and projects 5 lessons
- 72. XML with SimpleXML and DOMFree preview 15 min
- 73. Building a JSON API for AJAXFree preview 20 min
- 74. Web security essentialsFree preview 25 min
- 75. Project: a login systemFree preview 30 min
- 76. Final project: a school results portalFree preview 40 min
Reviews
No reviews yet.
