Getting the data types of fields in SOQL

I started working on a SOQL (Salesforce Object Query Language) client to retrieve and write data to SalesForce.

After looking online for a PHP way to get hold of all of the field names (as you cannot do SELECT * FROM in SOQL) I ended up looking in the actual SOAP client code, as online I could only find Apex/Java code.

Below is the code(s) that worked for me:

 echo '<pre>'.print_r(->describeSObject('Contact'),true).'</pre>';
 echo '<pre>'.print_r(->describeSObject('Account'),true).'</pre>';
 echo '<pre>'.print_r(->describeGlobal(),true).'</pre>';

Hope this helps someone!