| 365 |
lars |
1 |
String Encode
|
|
|
2 |
==========================
|
|
|
3 |
|
|
|
4 |
Version 1.0.1
|
|
|
5 |
|
|
|
6 |
String Encode is a simple PHP wrapper package to facilitate the encoding of strings in different charsets.
|
|
|
7 |
|
|
|
8 |
Install
|
|
|
9 |
-------
|
|
|
10 |
|
|
|
11 |
This package can be found on [packagist](https://packagist.org/packages/paquettg/stringencode) and is best loaded using [composer](http://getcomposer.org/). It does require php 7.1 or higher, so keep that in consideration.
|
|
|
12 |
|
|
|
13 |
Usage
|
|
|
14 |
-----
|
|
|
15 |
|
|
|
16 |
This is a really simple package so there is not much to say about it. The following is just about the only usage for this package at the moment.
|
|
|
17 |
|
|
|
18 |
```php
|
|
|
19 |
use stringEncode\Encode;
|
|
|
20 |
|
|
|
21 |
$str = "Calendrier de l'avent façon Necta!"
|
|
|
22 |
$encode = new Encode;
|
|
|
23 |
$encode->detect($str);
|
|
|
24 |
$newstr = $encode->convert($str);
|
|
|
25 |
echo $newstr; // "Calendrier de l'avent façon Necta!" in UTF-8 encoding (default)
|
|
|
26 |
```
|
|
|
27 |
|
|
|
28 |
As you can see, it is a very simple encoding converter.
|