A simple and organized PHP class for handling a variety of Unicode symbols including arrows, mathematical symbols, currency symbols, emojis, shapes, Greek letters, and miscellaneous symbols. This class allows easy access to commonly used Unicode characters for use in web applications, console outputs, or any other PHP projects.
- Easy access to a wide range of Unicode characters
- Categorized constants for better organization:
- Arrows
- Mathematical Symbols
- Currency Symbols
- Emojis
- Shapes and Symbols
- Greek Letters
- Miscellaneous Symbols
- Method to retrieve all Unicode constants in the class
- Clone the repository or download the
Unicode.php
class.
composer install rayblair06/unicode
use Rayblair/Unicode;
// Output a right arrow
echo Unicode::RIGHT_ARROW; // Outputs →
// Output a smiley face emoji
echo Unicode::SMILEY_FACE; // Outputs ☺
// Output a heart symbol
echo Unicode::HEART; // Outputs ❤
$allUnicodes = Unicode::getAll();
print_r($allUnicodes);
LEFT_ARROW
←RIGHT_ARROW
→UP_ARROW
↑DOWN_ARROW
↓DOUBLE_LEFT_ARROW
⇐DOUBLE_RIGHT_ARROW
⇒LEFT_RIGHT_ARROW
↔UP_DOWN_ARROW
↕CIRCLED_RIGHT_ARROW
↻LONG_LEFT_ARROW
⟵LONG_RIGHT_ARROW
⟶
INFINITY
∞SUMMATION
∑SQUARE_ROOT
√APPROXIMATELY_EQUAL
≈NOT_EQUAL
≠LESS_THAN_EQUAL
≤GREATER_THAN_EQUAL
≥PI_SYMBOL
π
DOLLAR_SIGN
$EURO_SIGN
€POUND_SIGN
£YEN_SIGN
¥INDIAN_RUPEE_SIGN
₹BITCOIN_SIGN
₿WON_SIGN
₩
SMILEY_FACE
☺HEART
❤STAR
★FIRE
🔥THUMBS_UP
👍CLAPPING_HANDS
👏PARTY_POPPER
🎉THINKING_FACE
🤔CRYING_FACE
😢
BLACK_CIRCLE
●WHITE_CIRCLE
○BLACK_SQUARE
■WHITE_SQUARE
□TRIANGLE_UP
▲TRIANGLE_DOWN
▼DIAMOND
◆BLACK_STAR
★WHITE_STAR
☆
ALPHA
αBETA
βGAMMA
γDELTA
δTHETA
θLAMBDA
λOMEGA
ω
CHECK_MARK
✓CROSS_MARK
✗COPYRIGHT
©REGISTERED
®TRADEMARK
™SECTION
§PILCROW
¶DEGREE
°BULLET
•ELLIPSIS
…INFINITY_SYMBOL
∞
Returns an associative array of all defined Unicode constants.
print_r(Unicode::getAll());
Output Example:
Array
(
[LEFT_ARROW] => ←
[RIGHT_ARROW] => →
[UP_ARROW] => ↑
[DOWN_ARROW] => ↓
[INFINITY] => ∞
[SMILEY_FACE] => ☺
[HEART] => ❤
)
- PHP 7.4 and above
- Works on any platform supporting PHP
To test the class, simply use the PHP built-in server:
php -S localhost:8000
Then access the test file in your browser:
http://localhost:8000/test.php
use Rayblair/Unicode;
echo "Arrows: " . Unicode::LEFT_ARROW . " " . Unicode::RIGHT_ARROW . "\n";
echo "Math Symbols: " . Unicode::INFINITY . " " . Unicode::PI_SYMBOL . "\n";
echo "Emojis: " . Unicode::SMILEY_FACE . " " . Unicode::HEART . "\n";
echo "Shapes: " . Unicode::BLACK_CIRCLE . " " . Unicode::WHITE_SQUARE . "\n";
Contributions are welcome! If you have more Unicode symbols to add or improvements to suggest, feel free to:
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License. See the LICENSE file for more details.
- Unicode Consortium for the extensive collection of symbols.
- Community contributors for ideas and symbol suggestions.
For issues or suggestions, feel free to open an issue on GitHub or contact me via email at [[email protected]].
If you find this project useful, consider giving it a ⭐️ on GitHub!
Feel free to edit or expand on this README.md
to better suit your project's needs. If you need any other modifications or features, let me know!