Skip to content

Find Your First PHP Lesson

Pick the description that fits you. Each path starts with one lesson and gives you something to try straight away.

Start with Write and Run Your First PHP Script. Open its browser example, change the greeting, and run it again. You’ve written your first PHP instruction when the output shows your new greeting.

To try it on your machine, install PHP and repeat the exercise in your terminal. When you’re ready for a small project, follow the PHP and SQLite reading list starter.

If you already build static pages, try PHP for HTML and CSS developers. There is also a first PHP script in Spanish.

Choose a lesson for a language you know. Pick one side-by-side example, run the PHP version, and change an input to see how it behaves. If you need PHP on your machine, start with the setup instructions.

You knowStart with
JavaScript or TypeScriptCompare the PHP and TypeScript type systems
PythonTranslate familiar Python syntax into PHP
Ruby or RailsCompare Ruby and PHP syntax
JavaWrite your first PHP script alongside Java
Another languageCall a function with a parameter and use its return value

Try Can PHP Be Typed?. Run the example that passes a numeric string to a typed function, then compare the default and strict results. It’s a short way to see what modern PHP enforces at runtime.

If you’re picking up an existing project, run php -v in the shell or container where that project runs. Use the PHP 8.5 to 8.6 upgrade checklist if that’s your next upgrade.

For more practice, try the seven-day PHP starter plan or explore the PHP resource library. If you already know what you want to build, browse all PHP courses.