Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 647 Bytes

preferred_symbol.md

File metadata and controls

29 lines (19 loc) · 647 Bytes

Preferred symbol

When there is an array of symbols in a currency, and you always want to choose the second one without specifying this, you can set your preferred symbol.

Methods

setPreferredSymbol([int $index = 0])

Parameters:

  1. [int $index = 0] (optional) - index of the array.

Returns: Currency

Usage

use PostScripton\Money\Currency;

$currency = currency("EGP");
$currency->setPreferredSymbol(1);

// ["£", "ج.م"]
$currency->getSymbol();     // "ج.م"
$currency->getSymbol(0);    // "£"
$currency->getSymbol(1);    // "ج.م"

📌 Back to the contents.