File: json.php

package info (click to toggle)
libjs-jush 2.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 992 kB
  • sloc: javascript: 6,929; php: 12; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 764 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>JSON</title>
<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="demo-dark.css">
<body>

<form action="" method="post">
<p><textarea name="json" rows="10" cols="50"><?php
if (isset($_POST["json"])) {
	echo htmlspecialchars($_POST["json"]);
}
?></textarea>
<p><input type="submit" value="JSON">
</form>

<pre><code class="language-js"><?php
if (isset($_POST["json"])) {
	echo htmlspecialchars(json_encode(json_decode($_POST["json"]), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
?></code></pre>

<script src="jush.js"></script>
<script>
jush.style('jush.css');
jush.style('jush-dark.css', '(prefers-color-scheme: dark)');
jush.highlight_tag('code');
</script>