Coding languages like all software has versions. These versions offer improvements, and changes over time. This means that functions that work in some versions do not work in others. So you need to verify which version of PHP code has been written for, and also think about using common functions in your code to prevent issues with running it on new versions of PHP.
You can turn your Raspberry Pi with Raspberry PI OS into a full LAMP web server. We use MariaDB because MySQL is not provided in the main repository and it is a drop in replacement […]
To learn PHP you’ll need a LAMP server of some sort, a text editor, and a good study guide. I highly recommend buying a book because it’s an excellent UI while learning a language.