I agree with the first and second answer, since I also did not find a solution to access most of iCloud data through PHP. It seems like the best solution would be to make a mobile application to do most of the work. It can save a lot of time.
However, if you can get your users to install the application, then create your own cloud. There is open source software, for example: the native Cloud code below, which is very good in it.
https://owncloud.org/
source share