In the olden times, there was compiled code. In the newer times, we still have to live with compiled code. We also have uncompiled code like php, so how does CI (continuous integration) work with that?

Continuous integration is the method of "re-compiling" software after each minor change, against a base of as few changes as possible. Say you were baking a cake and wanted to try a new butter; there's no way to check that the new butter is going to objectively make the cake taste nicer without making sure everything else is consistent.

CI is about making sure the 'only thing that changes is the butter' - or a variation thereof. You throw everything back into the mix with the new variation, and then test that the new 'bake' has baked successfully.

Why is CI useful for non-compiled languages?

As well as just baking - CI can be used for more advanced post-build actions like weighing, density checking, and avoiding the dreaded 'soggy bottom.'  In the PHP world there's a great set of tools available called the PHP QA Tools which have been curated by a dedicated team of PHP enthusiasts.  These can be configured to run 'post-integration' by the CI system to check anything from syntax through to cyclical complexity (a system of working out how complicated each function/method is).

In the new world, where systems are cheap, it can also be used to run-up servers and entire websites/databases so that you can check deployment practices.  Taking this a step further, you can look at automated testing tools like Behat to auto-check your code each time there's a change.  Given that the cost of these tests is massively reduced, it's become cost-effective to invest in CI systems versus manual testing.  Well written tests will also enable you to test in a exponential fashion; without incurring the costs of exponential manual tester hires.