How PHP get the content from web service?
<p>I have a problem in getting the content/array from web service to my php code. When I type in the url in browser like <a href="http://server1-xeon.asuscomm.com/currency/?amount=1.20,from=MYR,to=SGD" rel="nofollow">http://server1-xeon.asuscomm.com/currency/?amount=1.20,from=MYR,to=SGD</a>, then the result in the browser is displayed like this: [ 1.20MYR , 0.39SGD ]. My PHP code looks like this:</p>

<pre><code>$ch = curl_init('http://server1-xeon.asuscomm.com/currency/?amount=1.20,from=MYR,to=SGD');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($ch);
curl_close($ch);
echo $content;
</code></pre>

<p>Unfortunately, I get nothing use the code above. Looking for help.
Thanks.</p>

<p><strong>UPDATED</strong> </p>

<pre><code> $data=array(
'amount'=&gt;1.2,
'fromCurrency'=&gt;'MYR',
'toCurrency'=&gt;'SGD'
 );

 $data_string = json_encode($data);

 $ch = curl_init('http://server1-xeon.asuscomm.com/currency/WebService.asmx/YaHOO_CurrencyEx');

 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');                                                                     
 curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
 curl_setopt($ch, CURLOPT_HTTPHEADER, 
    array('Content-type: application/json'));                                                                                                       
$content= curl_exec($ch);
curl_close($ch);
$obj = json_decode($content);
echo $obj;
</code></pre>