Ok, well PHP is a scripting language for doing many things. There isn't really one thing its used for. Although, 99% of the time it must be used for websites.
This website is written in PHP although it no doubt had a database of some sort. Most websites written in PHP will use a database, because most websites store data.
You can edit and manage files, Work with XML, mathematical operations, validations, security related features.........
now clear? 😉