<?php
$json_fragment_from_api = '{\"caption\" => \"Genes (Comprehensive set from GENCODE 26)\",\"colour_key\" => \"[biotype]\",\"default\" => {\"MultiBottom\" => \"collapsed_label\",\"MultiTop\" => \"gene_label\",\"alignsliceviewbottom\" => \"as_collapsed_label\",\"contigviewbottom\" => \"transcript_label\",\"contigviewtop\" => \"gene_label\",\"cytoview\" => \"gene_label\"},\"key\" => \"ensembl\",\"label_key\" => \"[biotype]\",\"multi_name\" => \"GENCODE 26 Comprehensive gene set\",\"name\" => \"Comprehensive Gene Annotations from GENCODE 26\"}';
echo $json_frament_from_api;
echo "Alex Tartan:\n";
$string = $json_fragment_from_api;
$string = str_replace('\"','"', $string);
$string = str_replace('=>',':', $string);
echo $string;
echo "ikegami:\n";
$json_from_api = '{"result":' . $json_fragment_from_api . '}';
$response = json_decode($json_from_api, true);
$perl_code = $response["result"];
$desired_json = str_replace(' =>', ':', $perl_code);
echo $desired_json;
?>
preferences:
52.44 ms | 402 KiB | 5 Q