It was a while back I wrote a PHP manual for programming against VMware Virtual Infrastructure 3 (VI3). Assuming most of you run now-a-days vSphere 5.x I finally got around updating the samples :-)

I am using this code myself for my Raspberry PI analog monitor box for vSphere

You can find my basic explanation in the vSphere 5 PHP guide and the sample files in the download section