|
4 | 4 | //declare(strict_types=1); |
5 | 5 |
|
6 | 6 | /** |
7 | | - * AUTHOR : AVONTURE Christophe |
| 7 | + * AUTHOR : AVONTURE Christophe. |
8 | 8 | * |
9 | 9 | * Written date : 24 october 2018 |
10 | 10 | * |
|
15 | 15 |
|
16 | 16 | $task = filter_input(INPUT_POST, 'task', FILTER_SANITIZE_STRING); |
17 | 17 |
|
18 | | -if ($task == 'encode') { |
| 18 | +if ('encode' == $task) { |
19 | 19 | // Retrieve the JSON string |
20 | 20 | $JSON = base64_decode(filter_input(INPUT_POST, 'json', FILTER_SANITIZE_STRING)); |
21 | 21 |
|
|
28 | 28 | } |
29 | 29 |
|
30 | 30 | // Sample string; with accentuated characters and |
31 | | -$JSON = "this is a test\n". |
| 31 | +$JSON = "this is a test\n" . |
32 | 32 | "Paição São Paulo\n" . |
33 | | - "Nuit d'Été, ç'eût\n". |
34 | | - "(Sobre el Bé i el Mal) de Ciceró\n". |
35 | | - "inntrykk av å være lesbar"; |
| 33 | + "Nuit d'Été, ç'eût\n" . |
| 34 | + "(Sobre el Bé i el Mal) de Ciceró\n" . |
| 35 | + 'inntrykk av å være lesbar'; |
36 | 36 |
|
37 | 37 | // Get the GitHub corner |
38 | 38 | $github = ''; |
|
68 | 68 | <div class="page-header"><h1>JSON Encode</h1></div> |
69 | 69 | <div class="container"> |
70 | 70 | <div class="form-group"> |
| 71 | + <details> |
| 72 | + <summary>How to use?</summary> |
| 73 | + |
| 74 | + <div class="row"> |
| 75 | + <div class="col-sm"> |
| 76 | + <ul> |
| 77 | + <li>Type (or paste) a text in the text area here below</li> |
| 78 | + <li>Press the Encode button</li> |
| 79 | + </ul> |
| 80 | + </div> |
| 81 | + <div class="col-sm"> |
| 82 | + <img height="300px" src="https://raw.githubusercontent.com/cavo789/json_encode/master/images/demo.gif" alt="Demo"> |
| 83 | + </div> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </details> |
71 | 87 | <label for="JSON">Copy/Paste your text in the |
72 | 88 | textbox below then click on the Encode button:</label> |
73 | 89 | <textarea class="form-control" rows="5" id="JSON" name="JSON"><?php echo $JSON; ?></textarea> |
|
0 commit comments