The following functions can be called within HTML using [? funcname() ?] and from within PHP global scope. Most
PHP functions are also available.
Returns a formatted currency
Where the system currency is AUD and we just want to show the price [?? formatCurrency(15) ??] would simply render "$15.00 AUD"
Where system currency is AUD, and we want to show Approx.
NZD amount converts from AUD to NZD. [?? formatCurrency(15, null, 'NZD') ??] would render "Approx. $19.25 NZD"
Where system currency is AUD, and we want to show Approx. NZD amount when the amount is in EUR
Converts from EUR to AUD, then AUD to NZD [?? formatCurrency(15, 'EUR', 'NZD') ??] would render "Approx. $35.26 NZD "
Where system currency is AUD, and we want to display NZD amount
No conversion, just rendering. [?? formatCurrency(15, 'NZD') ??] would render "$15.00 NZD"
Parameters
float
$fPrice The price to be rendered
string|null
$strCurrencyId The currency code of $fPrice
string|null
$strCurrencyConvertId The currency code to convert to
bool
$bDisplayCurrencyId Whether to display the currency label - e.g. AUD
bool
$bDisplaySymbol Whether to display the currency sign - e.g. $
Make a HTTP request
This function can be used from within a PHP function to fetch data.
$str = makeHTTPRequest('https://www.googleapis.com/books/v1/volumes?q=' . htmlspecialchars($strQuery)); if ($str) { $arr = json_decode($str, true); }
- ONCORD_RETRY_COUNT: Number of retries on failure (default 0) - ONCORD_RETRY_SLEEP: Seconds to sleep between retries (default 5) - ONCORD_RETRY_ON_STRING: Array of strings to trigger retry if found in response - ONCORD_JSON_DECODE: If true, auto-decode JSON response and return array - ONCORD_JSON_LINE_STREAM: Enable progressive reading of JSON line-delimited responses. Each line should be JSON with optional 'progress', 'message', and 'status' fields. Updates thread progress via Threads::setCurrentProgress() and Threads::setCurrentProgressStatus(). Throws exception if status is 'error'. - ONCORD_JSON_LINE_STREAM_PROGRESS_OFFSET: Offset to add to progress values when using ONCORD_JSON_LINE_STREAM (default 0) - ONCORD_JSON_LINE_STREAM_PROGRESS_PERCENT: Percentage scale for progress values when using ONCORD_JSON_LINE_STREAM (default 100). The progress is calculated as: offset + (progress * percent/100)
Parameters
string
$strURL URL to request
array|null
$arrGET Query string parameters
array|null
$arrPOST POST body
array|null
$arrHeaders HTTP headers
array|null
$arrOtherOpts cURL opts. Also supports:
cURL|null
$pCurl Curl reference
Return
string|false Response body