Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JSON Encoder
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="tr" lang="tr">
<title> JSON Encoder </title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
if($_POST) {
$unicodes = array('\u015f', '\u015e', '\u011f', '\u011e', '\u0130', '\u0131', '\u00fc', '\u00dc', '\u00d6', '\u00f6', '\u00c7', '\u00e7');
$chars = array('ş', 'Ş', 'ğ', 'Ğ', 'İ', 'ı', 'ü', 'Ü', 'Ö', 'ö', 'Ç', 'ç');
if ($_POST['type'] == '1') {
$responseData = json_encode($_POST['text']);
$responseData = str_replace($unicodes, $chars, $responseData);
$responseData = json_decode($_POST['text']);
if ($responseData) {
<textarea cols="80" rows="10"><?=$responseData?></textarea>
<form method="post">
<p><textarea cols="80" rows="10" name="text"></textarea></p>
<p><button type="submit" name="type" value="1">Kodla</button><button type="submit" name="type" value="2">Geri Al</button></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.