phpjqueryhtmlapiclickatell

Display HTTP response on a webpage using PHP


I'm developing an SMS application using the clickatell API,

I want to show the credit balance on my page.

The http request to show the credit balance is:

http://api.clickatell.com/http/getbalance?api_id=xxx&user=xxx&password=xxx

This page returns "Credit: 158.500"

Is it possible to display this on my application/webpage using PHP?

I've looked all over and am clueless,

Many Thanks in advance


Solution

  • Try something like this:

     $credit = file_get_contents('http://api.clickatell.com/http/getbalance?api_id=xxx&user=xxx&password=xxx');
    

    PHP's file_get_contents function will retrieve the remote data. You can then echo the contents of $credit variable anywhere in your page.